]> granicus.if.org Git - php/commitdiff
Fixed bug #71806
authorNikita Popov <nikic@php.net>
Fri, 11 Mar 2016 21:45:38 +0000 (22:45 +0100)
committerNikita Popov <nikic@php.net>
Fri, 11 Mar 2016 21:45:38 +0000 (22:45 +0100)
NEWS
Zend/zend_highlight.c
ext/standard/tests/strings/bug71806.dat [new file with mode: 0644]
ext/standard/tests/strings/bug71806.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index bf9223b6f61bdbe0efd28295c309e1782529c7e7..ddbacdd051cf221cbbfd0a20162591fc4dd34e8b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,8 @@ PHP                                                                        NEWS
   . Fixed bug #71724 (yield from does not count EOLs). (Nikita)
   . Fixed bug #71767 (ReflectionMethod::getDocComment returns the wrong
     comment). (Grigorii Sokolik)
+  . Fixed bug #71806 (php_strip_whitespace() fails on some numerical values).
+    (Nikita)
 
 - Curl:
   . Fixed bug #71694 (Support constant CURLM_ADDED_ALREADY). (mpyw)
index 34fc4c2268bc6eecf7a436cb1be2af9f4ccb90cf..bc6456cee6ad31dc656b0743ff31ec4503928342 100644 (file)
@@ -228,6 +228,9 @@ ZEND_API void zend_strip(void)
                prev_space = 0;
                ZVAL_UNDEF(&token);
        }
+
+       /* Discard parse errors thrown during tokenization */
+       zend_clear_exception();
 }
 
 /*
diff --git a/ext/standard/tests/strings/bug71806.dat b/ext/standard/tests/strings/bug71806.dat
new file mode 100644 (file)
index 0000000..c999da6
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+/* comment */
+echo   098   ;
diff --git a/ext/standard/tests/strings/bug71806.phpt b/ext/standard/tests/strings/bug71806.phpt
new file mode 100644 (file)
index 0000000..6eb534d
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+Bug #71806 (php_strip_whitespace() fails on some numerical values)
+--FILE--
+<?php
+
+echo php_strip_whitespace(__DIR__ . '/bug71806.dat');
+
+?>
+--EXPECT--
+<?php
+ echo 098 ;