Jump to content
MakeWebGames

Ereg deprecated in email verification


gurpreet

Recommended Posts

I purchased Cronus' email verification mod a long time ago, and haven't looked at my website backup in over a year until today. I noticed when I put it on my WAMP server I got loads of errors to do with deprecated and I could fix them all except this one. I have no idea how to use preg_match properly, so maybe i could get some help?

if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)

if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name

 

There are more but not sure if I can post them up

Link to comment
Share on other sites

i also got an error like that.. ;

Deprecated: Function eregi() is deprecated in /home/*****/public_html/header.php on line 55

this is line 55:

if(eregi("[\'|'/'\''<'>'*'~'`']",$ids_checkpost) || strstr($ids_checkpost,'union') || strstr($ids_checkpost,'java') || strstr($ids_checkpost,'script') || strstr($ids_checkpost,'substring(') || strstr($ids_checkpost,'ord()')){

 

idk if its enough information but maybe someone over here got an fast fix for this ;)

Link to comment
Share on other sites

Exactly the same as has been said - it is deprecated.

Ereg and eregi are almost the same, the only difference that I know of is that eregi is case-insensitive.

 

Try: RegEx cheat sheet

the code is not exactly the same since his problem was in the email part and mine is in the header '.php' as you see

and also i am not an pro at this but i assume its like this?

 

if(!preg_match("[\'|'/'\''<'>'*'~'`']",$ids_checkpost) || strstr($ids_checkpost,'union') || strstr($ids_checkpost,'java') || strstr($ids_checkpost,'script') || strstr($ids_checkpost,'substring(') || strstr($ids_checkpost,'ord()')){

 

only changing eregi or ereg to !preg_match ?? what exactly is the difference o.0 between this.. and eregi..

i havent tested this yet.. but let me know if this is also right^^ ? and make changes if not. thx

Link to comment
Share on other sites

Okay i've also searched for sql_regcase on: http://www.php.net/manual/en/reference.pcre.pattern.posix.php

and its saying: sql_regcase() | No equivalent

and i've got this error:

Deprecated: Function sql_regcase() is deprecated in /home/*****/public_html/globals.php on line 38

and this is the line from the error..

$val = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$val);

 

and it only seems to help if i remove the full sql_regcase so it would be:

$val = preg_replace("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/");

 

someone with a explaination or possible solution (and thanks by the way for showing me those sites since changing it to "preg_match ... / ... /i" is working

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...