Satellitept Posted November 6, 2012 Posted November 6, 2012 Hello, since my server has updated php, i've been with a problem with the deprecated functions. I've searched the forum before and i've managed to arrange almost everything. my checkout_process.php have a part of a code i think it's not original and i can't put it to work. Deprecated: Function ereg_replace() is deprecated in .........../checkout_process.php on line 334 Deprecated: Function ereg_replace() is deprecated in ............./checkout_process.php on line 388 were I have errors : tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); $email_order=ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $email_order); and tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); $email_order=ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $email_order); Can you help me please? Is this part of the code enough for you to help me? Thank You
MrPhil Posted November 6, 2012 Posted November 6, 2012 $email_order=ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $email_order); change to $email_order=preg_replace("~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~","<a href=\"\\0\">\\0</a>", $email_order); It looks like the same for the second example. You're just changing the name of the function call, and adding "delimiters" to the search regular expression (in this case, "~"). http://php.net/manual/en/migration53.deprecated.php has a nice writeup on what to change in deprecated functions.
Satellitept Posted November 6, 2012 Author Posted November 6, 2012 Thanks a lot!! ;) It worked MrPhil, i was using "/" instead of "~" :/ next page, another error was created but with a search here, another topic resolved the question . Cheers :D
MrPhil Posted November 7, 2012 Posted November 7, 2012 I chose ~ because they weren't already used in the pattern. You could have used /, but then you would have had to escape the /'s already within the pattern: \/ (that's \ + /). It's easier to choose something like ~ or # as the delimiter.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.