Odd error with Winter CMS

I just found and solved a very peculiar issue. I installed a copy of Winter CMS (based on Laravel) but immediately started getting an error about a directory needing to be present and writable.

Long story short, Winter CMS does some fancy checking of paths against PHP’s open_basedir setting, which I discovered is used here. And normally this would not be a problem – unless the value for that setting is malformed.

Using dd() and ini_get(), I discovered that my open_basedir string value ends in a null byte (“\x00”), and this is what’s throwing off the code. I dug into the CMS library, wrapped “ini_get(‘open_basedir’)” with a call to rtrim(), and magically the issue was gone.

However, this is obviously not a long-term solution because the next time the library code is updated, my change will go away.

So I am just asking if the code that sets the open_basedir value for each account can be updated to NOT add a null byte at the end of the string?

I recognize this issue as something we found out already before. After a little bit of digging, it turns out that this issue was already uncovered last May:

It doesn’t seem like the issue has been fixed yet. I will check with iFastNet if there is anything new to report regarding this issue.

But it’s possible that this issue is low on the backlog because very few websites are actually affected by this. So you may need to keep patching the CMS to work around this issue for now.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.