Bug#422567: [php-maint] Bug#422567: strip_tags() does not handle single quotes correctly

Sean W. Mahan sean at paragoogle.com
Mon May 7 07:55:29 UTC 2007


> so if you are willing to take the time to dig up the fix we can consider
> whether it warrants an update to the stable branch of php.
>   

Thanks for getting back to me, Sean,

The fix is in ext/standard/string.c - here's the PHP.net diff to the
previous version:

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.44&r2=1.445.2.14.2.45

I must admit I don't know anything about C or your preferred method . 
The line numbers are different, but I downloaded the php5 source package
and pasted the changes in on the appropriate lines.  Pasted below is a
diff of the Debian-provided php5-5.2.0/ext/standard/string.c for
5.2.0-8+etch3, and a copy with the affected lines added.

Please let me know if there's a more appropriate way to submit this. 
Thanks for your work on Debian!

-Sean


4179c4179
<                                               state = 0;
---
>                                               in_q = state = 0;
4194c4194
<                                                       state = 0;
---
>                                                       in_q = state = 0;
4200c4200
<                                               state = 0;
---
>                                               in_q = state = 0;
4206c4206
<                                                       state = 0;
---
>                                                       in_q = state = 0;
4230a4231,4237
>                               if (state && p != buf && *(p-1) != '\\'
&& (!in_q || *p == in_q)) {
>                                       if (in_q) {
>                                               in_q = 0;
>                                       } else {
>                                               in_q = *p;
>                                       }
>                               }





More information about the pkg-php-maint mailing list