03-07-2011, 11:38 PM
(08-12-2010, 03:26 PM)alekseyn Wrote: so, below is my suggested replacement for this function in inc.FileUtils.php:
PHP Code:function makeDir($path)
{
global $settings;
$path1 = $settings->_contentDir; //from config
$path2 = substr_replace ($path, "/", 0, strlen($path1));
$mkfolder = $path1;
$path = preg_split( "/[\\\\\/]/" , $path2 );
for( $i=0 ; isset( $path[$i] ) ; $i++ )
{
if(!strlen(trim($path[$i])))continue;
$mkfolder .= $path[$i];
//echo $mkfolder." -> ";
if( !is_dir( $mkfolder ) ){
$res= @mkdir( "$mkfolder" , 0777);
if (!$res) return false;
}
$mkfolder .= DIRECTORY_SEPARATOR;
}
return true;
}
I am also attaching the modified file. PLEASE ALWAYS BACKUP YOUR FILES BEFORE ANY FILE REPLACEMENT OR MODIFICATION.
try is spacecop - use the attached file (replace yours in /inc/ folder) and let us know...
Matteo... please check my logic....
The current RC candidate on SF holds the old version of the code as well as the corrected patch (inc.FileUtils.php).