We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 335
    • 1 Posts
    Hi,
    I installed Modx 1.2.0 on an Apache with PHP version > 5.3.0
    WebLoginPE (version 1.3.1) returns an Error on "eregi()" function when checks email format during registration.

    ATTENTION! "eregi(...)" function is deprecated since PHP 5.3.0!

    So, I solved this little bug doing the substitution as following:
    replaced "eregi()" with "preg_match()" and corrected the Regular Expression with more details.

    FILE NAME: "webloginpe.class.php"
    LINE CODE: 2920

    CURRENT CODE:
    if (!eregi("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,7}$", $Email))


    I replaced this line code with
    REPLACE WITH:
    if (!preg_match("/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,7}$/", $Email))


    And now is all OK.

    I hope this will be useful for you!
    Thanks a lot wink
    Bye
    A. Castronuovo
    (ITALY)
      • 1169
      • 312 Posts
      Thanks acastronuovo

      I used this code works a treat.

      I was a bit stuck see:- http://modxcms.com/forums/index.php/topic,44582.0.html

      I wondered why you filed in parent board when ther is a WebloginPE Board.
      Just a thought not a crit.
      I now see many others also post WebloginPE there.

      Regards
        DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
        • 9025
        • 1 Posts
        Hi, Acastronuovo.
        I greatly liked your posting that I found while googling for a solution to my login page of pMachine (filename security.fsn.php), which was blocked after my ISP (one.com) upgraded from PhP 5.2 to PhP 5.3.

        However, I couldn’t make your trick work until I removed the exclamatory sign, i.e., instead of earlier:

        if ( !eregi("^[A-Za-z0-9\_\/\-]+$", $str))
        		{
        			exit('Disallowed Characters in your global keys');
        		}
        

        I wrote

        if (preg_match("/^[a-zA-Z0-9\_\/\-]+$", $str)) 
        		{
        			exit('Disallowed Characters in your global keys');
        		}
        


        This worked.