]> granicus.if.org Git - php/commitdiff
improve zlib version check for tests
authorAnatol Belski <ab@php.net>
Wed, 22 Mar 2017 10:04:08 +0000 (11:04 +0100)
committerAnatol Belski <ab@php.net>
Wed, 22 Mar 2017 10:08:38 +0000 (11:08 +0100)
ext/zlib/tests/func.inc

index 0a422cab780f10867447c35df99ca2d13db225da..e431afedbf32ea7bed5ed49718671103eaa946d3 100644 (file)
@@ -8,8 +8,10 @@ function get_zlib_version()
        phpinfo();
        $info = ob_get_contents();
        ob_end_clean();
-       if (preg_match(',zlib.*Compiled Version => (\d+\.\d+\.\d+),s', $info, $match)) {
-               $version = $match[1];
+       //if (preg_match(',zlib.*Compiled Version => (\d+\.\d+\.\d+),s', $info, $match)) {
+       //      $version = $match[1];
+       if (preg_match(',zlib(?!.*libXML).*Compiled Version (=> |</).*(\d+\.\d+\.\d+?),sU', $info, $match)) {
+               $version = $match[2];
        }
 
        return $version;