php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50408 REGEX : probleme with $1
Submitted: 2009-12-08 09:57 UTC Modified: 2009-12-08 10:02 UTC
From: tobias dot bora at gmail dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.2SVN-2009-12-08 (snap) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tobias dot bora at gmail dot com
New email:
PHP Version: OS:

 

 [2009-12-08 09:57 UTC] tobias dot bora at gmail dot com
Description:
------------
Hello,
I'm register at olympe-network.com, and when I put a regex send to the servor via http://www.spijoprod.net/outils/ftp_en_ligne/index.php, the regex :
######################################
#$chaine = preg_replace('#\[b\](.+)\[/b\]#i', '<strong>$1</strong>', #$chaine); 
########################################
is transformed in :
######################################
#$chaine = preg_replace('#\[b\](.+)\[/b\]#i', #'<strong>/(false|true|and|or|xor|__FILE__|exception|__LINE__|array|as|break|case|class|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|global|if|include|include_once|isset|list|new|print|require|require_once|return|static|switch|unset|use|var|while|__FUNCTION__|__CLASS__|__METHOD__|final|php_user_filter|interface|implements|extends|public|private|protected|abstract|clone|try|catch|throw|this)([ #\.\"\'\{\(;&<])/g</strong>', $chaine);
######################################
It's the $1 that php don't like.

Can you please repear this bug or tell me how can I use it ?

Thanks !

PS : excuse me but my english isn't very well...


Reproduce code:
---------------
<?php
function mezzocode($chaine)
{
/* GRAS */
$chaine = preg_replace('#\[b\](.+)\[/b\]#i', '<strong>/(false|true|and|or|xor|__FILE__|exception|__LINE__|array|as|break|case|class|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|global|if|include|include_once|isset|list|new|print|require|require_once|return|static|switch|unset|use|var|while|__FUNCTION__|__CLASS__|__METHOD__|final|php_user_filter|interface|implements|extends|public|private|protected|abstract|clone|try|catch|throw|this)([ \.\"\'\{\(;&<])/g</strong>', $chaine);


return $chaine;
}
?>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-08 10:02 UTC] jani@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 21:01:28 2024 UTC