From: Pierre Joye Date: Thu, 26 Jun 2003 14:38:04 +0000 (+0000) Subject: - reapply the fix about binary safe write mode (fix multiple sapi bug) X-Git-Tag: php-4.3.3RC2~245 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e82616ea6dfe58ea4ca8bba7fd47bd44980e804;p=php - reapply the fix about binary safe write mode (fix multiple sapi bug) --- diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 615a9c98a3..58541c5a67 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -261,7 +261,7 @@ class PEAR_Installer extends PEAR_Common if (sizeof($subst_from)) { $contents = str_replace($subst_from, $subst_to, $contents); } - $wp = @fopen($dest_file, "w"); + $wp = @fopen($dest_file, "wb"); if (!is_resource($wp)) { return $this->raiseError("failed to create $dest_file: $php_errormsg", PEAR_INSTALLER_FAILED); diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php index 507b9f6041..58e550992c 100644 --- a/pear/PEAR/Packager.php +++ b/pear/PEAR/Packager.php @@ -121,7 +121,7 @@ class PEAR_Packager extends PEAR_Common return $this->raiseError("PEAR_Packager: mktemp failed"); } $newpkgfile = $tmpdir . DIRECTORY_SEPARATOR . 'package.xml'; - $np = @fopen($newpkgfile, "w"); + $np = @fopen($newpkgfile, "wb"); if (!$np) { chdir($oldcwd); return $this->raiseError("PEAR_Packager: unable to rewrite $pkgfile as $newpkgfile"); @@ -173,4 +173,4 @@ if (!function_exists('md5_file')) { } } -?> \ No newline at end of file +?> diff --git a/pear/PEAR/Registry.php b/pear/PEAR/Registry.php index b5a29f6d4c..16a9b497d4 100644 --- a/pear/PEAR/Registry.php +++ b/pear/PEAR/Registry.php @@ -219,7 +219,7 @@ class PEAR_Registry extends PEAR } } $this->_assertStateDir(); - $fp = @fopen($this->filemap, 'w'); + $fp = @fopen($this->filemap, 'wb'); if (!$fp) { return false; } @@ -568,7 +568,7 @@ class PEAR_Registry extends PEAR if (PEAR::isError($e = $this->_lock(LOCK_EX))) { return $e; } - if (!$fp = fopen($this->depfile, 'w')) { + if (!$fp = fopen($this->depfile, 'wb')) { $this->_unlock(); return $this->raiseError("Could not open dependencies file `".$this->depfile."' for writting"); }