php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23794 Recurrance of bug #3269
Submitted: 2003-05-24 17:51 UTC Modified: 2003-05-24 19:43 UTC
From: kelly dot mctiernan at verizon dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.1 OS: Solaris 8
Private report: No CVE-ID: None
 [2003-05-24 17:51 UTC] kelly dot mctiernan at verizon dot net
I am experincing the exact same behavior as described in bug report #3269 on Solaris 8/PHP 4.3.1/Apache 1.3.27.

i.e:
<? 
        $regexes = array("/(bold)/i", "/(something)/"); 
        $text = "This is really something to see! A bold new achievement in the world of bugs. Not to mention something that I probably misspeled there. Woo hoo!"; 
        $new = preg_replace($regexes, "<B>\\1</B>", $text); 
        print $new; 
?> 

Result:

This is really <B>something</B> to see! A <B>bold</B> new achievement in the world of bugs. Not to mention <B>something</B> that I probably misspeled there. Woo hoo!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-24 19:06 UTC] kelly dot mctiernan at verizon dot net
I'm sorry, it appears to be behavig correctly.  This test was copied directly from bug report #3269, which was the only problem I found regarding Solaris/preg_replace. I should have investigated more closely. Anyway, my problem is I'm getting the following error: 

Warning: Compilation failed: range out of order in character class at offset 13 in /usr/local/apache/htdocs/kbstudio/admin/map_site.php on line 168

line 168 is 
$html_text = preg_replace("/[^a-zA-Z\200-\220\301-\236$numbers ]/"," ",$html_text);

This exact script behaves beautifully on Linux with the exact same configuration.  Also my phpshop is giving strange warnings.  I'm using gcc 2.95 on Solaris to complile and gcc 3.0 on Linux.  Perhaps that's the issue?
 [2003-05-24 19:27 UTC] moriyoshi@php.net
The regex line is simply wrong and it shouldn't work in any situation.

[^a-zA-Z\200-\220\301-\236$numbers ]/
                 ^^^^^^^^^

A character class should be represented by a sequence of any character, a hyphen and a character with character code greater than the first. (\236 is not greater than \301)

I guess \236 is a typo of \336.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 19:01:32 2024 UTC