Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

php5.3 problems checkout_processs


Satellitept

Recommended Posts

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

Link to comment
Share on other sites

$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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...