]> granicus.if.org Git - php/commitdiff
- reapply the fix about binary safe write mode (fix multiple sapi bug)
authorPierre Joye <pajoye@php.net>
Thu, 26 Jun 2003 14:38:04 +0000 (14:38 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 26 Jun 2003 14:38:04 +0000 (14:38 +0000)
pear/PEAR/Installer.php
pear/PEAR/Packager.php
pear/PEAR/Registry.php

index 615a9c98a352a0794c80cdb95e2c1b6d895e3f1c..58541c5a67d34b5fbd39958fa13833927e71d9a6 100644 (file)
@@ -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);
index 507b9f6041c1e1b3c017809058a903e28b5d5727..58e550992c3c11889457b1621175abb7f85d6a72 100644 (file)
@@ -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
+?>
index b5a29f6d4c8bb62e7096b25e0420ab7d164971d1..16a9b497d4c092945c184bb42c5862519c354e98 100644 (file)
@@ -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");
         }