Using " in the additional directives configuration breaks CloudPanel #519

Closed
opened 2026-04-05 20:28:03 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @AjdinDev on 7/12/2022

CloudPanel version(s) affected

2.0.2

Description

Using " quotes in the additional configuration directives field will break everything due to parsing issues in the config. More explanation below.

How to reproduce

I saved a php.ini directive between "" in the "Additional Configuration Directives" field and it didn't give any errors. I did notice that the directive wasn't working properly. A while later, I restarted the instance and while the server was up, cloudpanel or the websites weren't. After trying to manually start nginx it failed with a configuration error which looked like following:
image

The content of said nginx config:
image

It's not quite liking the session save path input due to the quotes.

After manually removing that from the nginx config and rebooting nginx, cloudpanel and the website were reachable again.

This is the additional directive configuration I used:
image

Possible Solution

I would implement better checks in the input field, perhaps replacing all " with '.

Additional Context

No response

*Originally created by @AjdinDev on 7/12/2022* ### CloudPanel version(s) affected 2.0.2 ### Description Using " quotes in the additional configuration directives field will break everything due to parsing issues in the config. More explanation below. ### How to reproduce I saved a php.ini directive between "" in the "Additional Configuration Directives" field and it didn't give any errors. I did notice that the directive wasn't working properly. A while later, I restarted the instance and while the server was up, cloudpanel or the websites weren't. After trying to manually start nginx it failed with a configuration error which looked like following: <img width="1302" alt="image" src="https://user-images.githubusercontent.com/13615277/178533917-9ef3137f-9a7d-4c03-8992-b5f60099289b.png"> The content of said nginx config: <img width="1267" alt="image" src="https://user-images.githubusercontent.com/13615277/178536591-ff6822cb-929a-4e44-aca1-d48e16a4b907.png"> It's not quite liking the session save path input due to the quotes. After manually removing that from the nginx config and rebooting nginx, cloudpanel and the website were reachable again. This is the additional directive configuration I used: <img width="1156" alt="image" src="https://user-images.githubusercontent.com/13615277/178535455-f4075007-0e8a-48b7-ab57-61780ba3c2b5.png"> ### Possible Solution I would implement better checks in the input field, perhaps replacing all " with '. ### Additional Context _No response_
Sign in to join this conversation.