Browse Source

fix #279

PEAR_1_4DEV
Greg Beaver 22 years ago
parent
commit
06ef18bed9
  1. 3
      pear/PEAR/Config.php
  2. 6
      pear/PEAR/Registry.php

3
pear/PEAR/Config.php

@ -615,7 +615,10 @@ class PEAR_Config extends PEAR
return $this->raiseError("PEAR_Config::readConfigFile fopen('$file','r') failed");
}
$size = filesize($file);
$rt = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
$contents = fread($fp, $size);
set_magic_quotes_runtime($rt);
fclose($fp);
$version = '0.1';
if (preg_match('/^#PEAR_Config\s+(\S+)\s+/si', $contents, $matches)) {

6
pear/PEAR/Registry.php

@ -239,7 +239,10 @@ class PEAR_Registry extends PEAR
return $this->raiseError('PEAR_Registry: could not open filemap', PEAR_REGISTRY_ERROR_FILE, null, null, $php_errormsg);
}
$fsize = filesize($this->filemap);
$rt = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
$data = fread($fp, $fsize);
set_magic_quotes_runtime($rt);
fclose($fp);
$tmp = unserialize($data);
if (!$tmp && $fsize > 7) {
@ -334,7 +337,10 @@ class PEAR_Registry extends PEAR
if ($fp === null) {
return null;
}
$rt = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
$data = fread($fp, filesize($this->_packageFileName($package)));
set_magic_quotes_runtime($rt);
$this->_closePackageFile($fp);
$data = unserialize($data);
if ($key === null) {

Loading…
Cancel
Save