summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Pauli <jpauli@php.net>2016-02-02 18:32:38 +0100
committerJulien Pauli <jpauli@php.net>2016-02-02 18:32:38 +0100
commit15b1efeba88563a30978f7cafa15abd7cd85bc9e (patch)
tree4cc63df5749908b150bb9e350dc57dcf9b40220d
parent813ecfb49fc59d8fd74e4982ed2c9ff01e32b531 (diff)
downloadphp-git-15b1efeba88563a30978f7cafa15abd7cd85bc9e.tar.gz
Revert "Fix #70720"
This reverts commit ff7ed9021cd72a7f82dd4301cdc266afdff458ad.
-rw-r--r--ext/standard/string.c5
-rw-r--r--ext/standard/tests/strings/bug70720.phpt12
2 files changed, 1 insertions, 16 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 5889b87ffb..56b748a6ab 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4689,9 +4689,6 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow,
switch (state) {
case 1: /* HTML/XML */
lc = '>';
- if (*(p -1) == '-') {
- break;
- }
in_q = state = 0;
if (allow) {
if (tp - tbuf >= PHP_TAG_BUF_SIZE) {
@@ -4821,7 +4818,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow,
* state == 2 (PHP). Switch back to HTML.
*/
- if (state == 2 && p > buf+2 && strncasecmp(p-4, "<?xm", 4) == 0) {
+ if (state == 2 && p > buf+2 && strncasecmp(p-2, "xm", 2) == 0) {
state = 1;
break;
}
diff --git a/ext/standard/tests/strings/bug70720.phpt b/ext/standard/tests/strings/bug70720.phpt
deleted file mode 100644
index edf60080ac..0000000000
--- a/ext/standard/tests/strings/bug70720.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-Bug #70720 (strip_tags() doesnt handle "xml" correctly)
---FILE--
-<?php
-var_dump(strip_tags('<?php $dom->test(); ?> this is a test'));
-var_dump(strip_tags('<?php $xml->test(); ?> this is a test'));
-var_dump(strip_tags('<?xml $xml->test(); ?> this is a test'));
-?>
---EXPECTF--
-string(15) " this is a test"
-string(15) " this is a test"
-string(15) " this is a test" \ No newline at end of file