Menu

#433 (ok 3.1.2) ereg*() deprecated in PHP 5.3

closed-accepted
PHP errors (22)
1
2009-01-19
2008-12-08
Alex Frase
No

PHP 5.3 (currently alpha 3, expected release sometime in 2009) will deprecate the ereg*() suite of POSIX regular expression functions, so they must be replaced with preg*() equivalents.

I did a quick search for "ereg" in the public 3.1.0-english codebase and made the necessary changes. I have not tested these extensively by any means, but in most cases they were simple replacements and my copy seems to run fine in basic usage on PHP 5.3alpha3.

A few files have comments that refer to ereg*() functions even though ereg*() functions are not actually called in those functions; I ignored these.

A few files build regex patterns using variables from an external source, which I didn't take the time to trace back and analyze for whether they might contain standard preg delimeters ("/"). In these cases I just wrapped the variable in addcslashes($v,'/') to escape them.

Attached is my diff, hope its useful.

Discussion

  • Alex Frase

    Alex Frase - 2008-12-08

    pMA-3.1.0-english diff, ereg() -> preg()

     
  • Marc Delisle

    Marc Delisle - 2008-12-09

    Moved to patches.

     
  • Marc Delisle

    Marc Delisle - 2008-12-09
    • milestone: 896443 -->
    • labels: 438951 --> PHP errors
     
  • Marc Delisle

    Marc Delisle - 2008-12-13
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2008-12-14
    • priority: 5 --> 1
    • summary: ereg() deprecated in PHP 5.3 --> (ok 3.1.2) ereg() deprecated in PHP 5.3
    • status: open --> open-accepted
     
  • Marc Delisle

    Marc Delisle - 2008-12-14

    Merged, thanks for the good job!

     
  • Marc Delisle

    Marc Delisle - 2009-01-19
    • status: open-accepted --> closed-accepted