2b3ez / FileManager4TinyMCE

Plugin for manage and upload file for TinyMCE 4
151 stars 74 forks source link

Bug in utils.php in function create_folder #32

Closed ahjohnston25 closed 11 years ago

ahjohnston25 commented 11 years ago

mkdir fails with error if subdirectory is set to more than one directory (e.g. subfolder : /foo/bar) when called from the create_folder function in utils.php

This issue can be fixed by adding the recursive flag to the mkdir calls on lines 38 and 40 as follows:

function create_folder($path=false,$path_thumbs=false){
    $oldumask = umask(0); 
    if ($path && !file_exists($path))
        mkdir($path, 0777, true); // or even 01777 so you get the sticky bit set 
    if($path_thumbs && !file_exists($path_thumbs)) 
        mkdir($path_thumbs, 0777, true) or die("$path_thumbs cannot be found"); // or even 01777 so you get the sticky bit set 
    umask($oldumask);
}
trippo commented 11 years ago

thanks i'll fix this in the new version. subscribe to newsletter to stay tuned :)