[Phpfreechat-svn] SF.net SVN: phpfreechat: [637] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-07-03 13:17:25
|
Revision: 637 Author: kerphi Date: 2006-07-03 06:17:20 -0700 (Mon, 03 Jul 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=637&view=rev Log Message: ----------- Change the default directory creation rights to 755 in order to allow incorrect configured web servers to access to these directories. Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php trunk/src/pfctools.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-30 17:02:35 UTC (rev 636) +++ trunk/src/pfcglobalconfig.class.php 2006-07-03 13:17:20 UTC (rev 637) @@ -210,15 +210,15 @@ $dir2 = $this->data_private_path."/copy_r2"; $file2 = $dir2."/dummy"; // create a dummy directory - mkdir($dir1); + @mkdir($dir1); // check the directory exists if (!file_exists($dir1) || !is_dir($dir1)) $copy_r_ok = false; // create a dummy file - touch($file1); + @touch($file1); // check the file exists if (!file_exists($file1)) $copy_r_ok = false; // copy_r the dummy dir - copy_r($dir1,$dir2); + @copy_r($dir1,$dir2); // check the directory exists if (!file_exists($dir2) || !is_dir($dir2)) $copy_r_ok = false; // check the file exists @@ -228,8 +228,8 @@ // try to remove recursively the directory $rm_r_ok = true; - rm_r($dir2); - rm_r($dir1); + @rm_r($dir2); + @rm_r($dir1); // check the directory doesn't exists if (file_exists($dir1) || file_exists($dir2)) $rm_r_ok = false; // check the file doesn't exists Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2006-06-30 17:02:35 UTC (rev 636) +++ trunk/src/pfctools.php 2006-07-03 13:17:20 UTC (rev 637) @@ -119,13 +119,14 @@ function rm_r($dir) { + $dir = realpath($dir); if(!$dh = @opendir($dir)) return; while (($obj = readdir($dh))) { if($obj=='.' || $obj=='..') continue; if (!@unlink($dir.'/'.$obj)) rm_r($dir.'/'.$obj); } - @rmdir($dir); + rmdir($dir); } /** @@ -137,7 +138,7 @@ * @param string $dest Destination path * @return bool Returns TRUE on success, FALSE on failure */ -function copy_r($source, $dest, $modedir = 0700, $modefile = 0644) +function copy_r($source, $dest, $modedir = 0755, $modefile = 0644) { // Simple copy for a file if (is_file($source)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |