From a25530f6594c7ba45b3faa9537fda9f807069759 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 28 Jan 2008 17:11:02 +0000 Subject: added is_really_writable() to Common.php, replaced is_writable() throughout application with is_really_writable() --- system/helpers/file_helper.php | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 5fb31cfaa..868561b5a 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -178,39 +178,4 @@ function get_filenames($source_dir, $include_path = FALSE) // -------------------------------------------------------------------- -/** - * Tests for file writability - * - * is_writable() returns TRUE on Windows servers - * when you really can't write to the file - * as the OS reports to PHP as FALSE only if the - * read-only attribute is marked. Ugh? - * - * @access private - * @return void - */ -function is_really_writable($file) -{ - if (is_dir($file)) - { - $file = rtrim($file, '/').'/'.md5(rand(1,100)); - - if (($fp = @fopen($file, 'ab')) === FALSE) - { - return FALSE; - } - - fclose($fp); - @chmod($file, 0777); - @unlink($file); - return TRUE; - } - elseif (($fp = @fopen($file, 'ab')) === FALSE) - { - return FALSE; - } - - fclose($fp); - return TRUE; -} ?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b