- Upgraded PCRE to version 7.0 (Nuno)
- Add --ri switch to CLI which allows to check extension information. (Marcus)
- Added tidyNode::getParent() method (John, Nuno)
+- Fixed bug #40432 (strip_tags() fails with greater than in attribute). (Ilia)
- Fixed bug #40431 (dynamic properties may cause crash in ReflectionProperty
methods). (Tony)
- Fixed bug #40428 (imagepstext() doesn't accept optional parameter). (Pierre)
PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, int allow_len, zend_bool allow_tag_spaces)
{
char *tbuf, *buf, *p, *tp, *rp, c, lc;
- int br, i=0, depth=0;
+ int br, i=0, depth=0, in_q = 0;
int state = 0;
if (stateptr)
if (allow) {
tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp);
*(tp++) = '<';
- }
+ }
} else if (state == 1) {
depth++;
}
depth--;
break;
}
-
+
+ if (in_q) {
+ break;
+ }
+
switch (state) {
case 1: /* HTML/XML */
lc = '>';
tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp);
*(tp++) = c;
}
+ if (*(p-1) != '\\') {
+ in_q = !in_q;
+ }
break;
case '!':