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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 00:01:29 2024 UTC