From 14031d152b76e7744d6f8a70964ecae77ca55179 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 5 May 2008 18:29:43 +0000 Subject: implemented fopen mode constants --- system/libraries/Email.php | 2 +- system/libraries/Log.php | 2 +- system/libraries/Upload.php | 2 +- system/libraries/Zip.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 3b4dddd00..d71f593e9 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1070,7 +1070,7 @@ class CI_Email { $attachment[$z++] = $h; $file = filesize($filename) +1; - if (! $fp = fopen($filename, 'r')) + if (! $fp = fopen($filename, FOPEN_READ_BOF)) { $this->_set_error_message('email_attachment_unreadable', $filename); return FALSE; diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 247aee13c..370ab7922 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -97,7 +97,7 @@ class CI_Log { $message .= "<"."?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; } - if (! $fp = @fopen($filepath, "a")) + if (! $fp = @fopen($filepath, FOPEN_WRITE_CREATE_EOF)) { return FALSE; } diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index f13907000..853c162bd 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -741,7 +741,7 @@ class CI_Upload { return FALSE; } - if (! $fp = @fopen($file, 'r+b')) + if (! $fp = @fopen($file, FOPEN_READ_WRITE_BOF)) { return FALSE; } diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 4bdc92547..6b5988017 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -301,7 +301,7 @@ class CI_Zip { */ function archive($filepath) { - if (! ($fp = @fopen($filepath, "wb"))) + if (! ($fp = @fopen($filepath, FOPEN_WRITE_CREATE_BOF))) { return FALSE; } -- cgit v1.2.3-24-g4f1b