Hi
I know this is a really old topic but I came across it today when I upgraded one of my old websites from Evolution version 1.0.4 to the latest Evolution version 1.0.15 (Yes I know this is a big version difference but the website worked fine for what it was meant to do).
What happened was after the upgrade everything worked except for the KCFinder as it was implying safe_mode was on.
While I thought I was sure the setting was not set to "on" in my php.ini I did go and did a double check. I found that the setting indeed was set to "off" how it should be.
So why was KCFinder still having issues?
After a search for "safe_mode" in the complete MODx source code I noticed a few IF statements that seem to be making the error.
The one that killed the KCFinder for example
if (ini_get("safe_mode"))
die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode.");
This IF statement generated a TRUE because the ini_get() function returned a string and not a boolean.
var_dump(ini_get('safe_mode')); //returns: string(3) "off"
I also found this in "assets\plugins\managermanager\widgets\ddresizeimage\phpthumb.class.php":
$this->issafemode = (bool) preg_match('#(1|ON)#i', ini_get('safe_mode'));
This bit works correct as it checks if the value of ini_get('safe_mode') is either 1 or "on".
So I located all bits where the ini_get value was treated as a boolean by default and changed them.
For example the IF statement I mentioned above became:
if ((bool) preg_match('#(1|ON)#i', ini_get('safe_mode')))
die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode.");
After uploading all the changed files to the server KCFinder worked perfectly again.
Even in an old topic like this I hope this helps someone.
Greets,
Bas