diff options
-rw-r--r-- | pear/PEAR/Remote.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php index 5662e9de01..0d1a11556c 100644 --- a/pear/PEAR/Remote.php +++ b/pear/PEAR/Remote.php @@ -62,10 +62,17 @@ class PEAR_Remote extends PEAR if (!file_exists($filename)) { return null; }; + + $fp = fopen($filename, "rb"); + if ($fp === null) { + return null; + } + $content = fread($fp, filesize($filename)); + fclose($fp); $result = array( 'age' => time() - filemtime($filename), 'lastChange' => filemtime($filename), - 'content' => unserialize(implode('', file($filename))), + 'content' => unserialize($content), ); return $result; } @@ -83,7 +90,7 @@ class PEAR_Remote extends PEAR } $filename = $cachedir.'/xmlrpc_cache_'.$id; - $fp = @fopen($filename, "w"); + $fp = @fopen($filename, "wb"); if ($fp !== null) { fwrite($fp, serialize($data)); fclose($fp); |