Results 1 to 2 of 2

Thread: ereg_replace to preg_replace

  1. #1

    Default ereg_replace to preg_replace

    Hi there, I have a very old TL installation 2.6.7 which has in controller.php
    Code:
    $strGdVersion = ereg_replace('[[:alpha:][:space:]()]+', '', $arrGdinfo['GD Version']);
    Just a few days back my Hoster has upgraded PHP version to 5.3, and this causes a problem resulting in black jpg/jpeg pictures.

    Without thinking much I've changed the above from a newer contao to (As i knew ereg function is depricated in php 5.3)
    Code:
    $strGdVersion = preg_replace('/[^0-9\.]+/', '', $arrGdinfo['GD Version']);
    and it works. But I am not sure if this might lead to other problems. Is it ok with what I have done? Thanks
    OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world

  2. #2
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: ereg_replace to preg_replace

    Hi,

    Contao uses preg_replace() from 2.9.5 at least.
    --
    Takahiro Kambe

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •