diff --git a/PEAR/Config.php b/PEAR/Config.php index 39c5116e4..d31cad131 100644 --- a/PEAR/Config.php +++ b/PEAR/Config.php @@ -1070,10 +1070,7 @@ function _readConfigDataFrom($file) } if ($version && version_compare("$version", '1', '<')) { - // no '@', it is possible that unserialize - // raises a notice but it seems to block IO to - // STDOUT if a '@' is used and a notice is raise - $data = unserialize($contents); + $data = @unserialize($contents); if (!is_array($data) && !$data) { if ($contents == serialize(false)) { diff --git a/PEAR/DependencyDB.php b/PEAR/DependencyDB.php index 435b54000..122717fd2 100644 --- a/PEAR/DependencyDB.php +++ b/PEAR/DependencyDB.php @@ -560,7 +560,7 @@ function _getDepDB() clearstatcache(); fclose($fp); - $data = unserialize(file_get_contents($this->_depdb)); + $data = @unserialize(file_get_contents($this->_depdb)); $this->_cache = $data; return $data; } diff --git a/PEAR/Registry.php b/PEAR/Registry.php index 77941556d..144e4a18a 100644 --- a/PEAR/Registry.php +++ b/PEAR/Registry.php @@ -1143,7 +1143,7 @@ function _packageInfo($package = null, $key = null, $channel = 'pear.php.net') clearstatcache(); $this->_closePackageFile($fp); $data = file_get_contents($this->_packageFileName($package, $channel)); - $data = unserialize($data); + $data = @unserialize($data); if ($key === null) { return $data; } diff --git a/tests/PEAR_RunTest/test_bug10092post_raw1-81.phpt b/tests/PEAR_RunTest/test_bug10092post_raw1-81.phpt new file mode 100644 index 000000000..be6fc98bd --- /dev/null +++ b/tests/PEAR_RunTest/test_bug10092post_raw1-81.phpt @@ -0,0 +1,56 @@ +--TEST-- +PEAR_RunTest --POST_RAW-- normal +--SKIPIF-- + +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="submitter" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="pics"; filename="bug37276.txt" +Content-Type: text/plain + +bug37276 + +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(1) { + ["pics"]=> + array(6) { + ["name"]=> + string(12) "bug37276.txt" + ["full_path"]=> + string(12) "bug37276.txt" + ["type"]=> + string(10) "text/plain" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(%d) + } +} +array(1) { + ["submitter"]=> + string(8) "testname" +} +string(0) "" diff --git a/tests/PEAR_RunTest/test_bug10092post_raw1.phpt b/tests/PEAR_RunTest/test_bug10092post_raw1.phpt index 94eafc403..8e1d98291 100644 --- a/tests/PEAR_RunTest/test_bug10092post_raw1.phpt +++ b/tests/PEAR_RunTest/test_bug10092post_raw1.phpt @@ -5,6 +5,9 @@ PEAR_RunTest --POST_RAW-- normal if (!getenv('PHP_PEAR_RUNTESTS')) { echo 'skip'; } +if (version_compare(PHP_VERSION, '8.1.0', '>=')) { + echo 'skip'; +} ?> --POST_RAW-- Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 diff --git a/tests/PEAR_RunTest/test_bug10092upload-81.phpt b/tests/PEAR_RunTest/test_bug10092upload-81.phpt new file mode 100644 index 000000000..0151c0fc9 --- /dev/null +++ b/tests/PEAR_RunTest/test_bug10092upload-81.phpt @@ -0,0 +1,65 @@ +--TEST-- +PEAR_RunTest --UPLOAD-- +--SKIPIF-- + +--POST-- +hi=there&fool=you +--UPLOAD-- +file1.txt=setup.php.inc +myfile2.txt=test_bug9971.phpt +--FILE-- + +--EXPECTF-- +array(2) { + ["file1_txt"]=> + array(6) { + ["name"]=> + string(13) "setup.php.inc" + ["full_path"]=> + string(13) "setup.php.inc" + ["type"]=> + string(10) "text/plain" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(%d) + } + ["myfile2_txt"]=> + array(6) { + ["name"]=> + string(17) "test_bug9971.phpt" + ["full_path"]=> + string(17) "test_bug9971.phpt" + ["type"]=> + string(10) "text/plain" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(%d) + } +} +array(2) { + ["hi"]=> + string(5) "there" + ["fool"]=> + string(3) "you" +} +string(0) "" diff --git a/tests/PEAR_RunTest/test_bug10092upload.phpt b/tests/PEAR_RunTest/test_bug10092upload.phpt index 9024db43a..97cdd0883 100644 --- a/tests/PEAR_RunTest/test_bug10092upload.phpt +++ b/tests/PEAR_RunTest/test_bug10092upload.phpt @@ -5,6 +5,9 @@ PEAR_RunTest --UPLOAD-- if (!getenv('PHP_PEAR_RUNTESTS')) { echo 'skip'; } +if (version_compare(PHP_VERSION, '8.1.0', '>=')) { + echo 'skip'; +} ?> --POST-- hi=there&fool=you