Date: 07/20/00
- Next message: Andi Gutmans: "[PHP-DEV] Bugs database"
- Previous message: john.hallam <email protected>: "[PHP-DEV] PHP 4.0 Bug #5702: Inserting an uploaded JPEG file into Openldap"
- In reply to: wico <email protected>: "[PHP-DEV] PHP 4.0 Bug #5676: preg_replace and 'e' modifyer eval problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 12:36 19-7-00 +0000, wico <email protected> wrote:
>From: wico <email protected>
>Operating system: linux
>PHP version: 4.0 Latest CVS (19/07/2000)
>PHP Bug Type: Scripting Engine problem
>Bug description: preg_replace and 'e' modifyer eval problem
>
><?
> echo preg_replace("'<(.*?)>'ime", "Wico('\\1');", "try <'to'
> match \"this\"> in php");
>
> function Wico ($plop) {
> return("plop");
> }
>?>
>
>// this will work better I think (if you guys are so nice want to build
>into php for us
>// i can't replace all ' with " or visaversa
Ok i think it isn't the sollution to put the match into a var ($1)
but trowing a addslashes at the found match will be a good start:
to make it easy for you :)
i think it should be change somewhere in function preg_do_eval
(etx/pcre/php_pcre.c)
558 + 559:
match = subject + offsets[backref<<1];
match_len = offsets[(backref<<1)+1] - offsets[backref<<1];
someone said to me to add this after thos statements:
match = php_addslashes(match,0, &match_len,0); match_len--;
the problem of the eval is fixed then but the founded match is to long when
you get it in the function.
I'm not a c programmer, so if someone could fix this please
and send me a diff or even better puts it in the cvs my day will be good
(and i can continue to work, boss also happy :)
Greetz,
Wico
><?
> echo preg_replace("'<(.*?)>'ime", "Wico($1);", "try <'to' match
> \"this\"> in php");
>
> function Wico ($plop) {
> return("plop");
> }
>?>
>
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andi Gutmans: "[PHP-DEV] Bugs database"
- Previous message: john.hallam <email protected>: "[PHP-DEV] PHP 4.0 Bug #5702: Inserting an uploaded JPEG file into Openldap"
- In reply to: wico <email protected>: "[PHP-DEV] PHP 4.0 Bug #5676: preg_replace and 'e' modifyer eval problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

