Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

preg_replace() with /e modifier


jimlongo

Recommended Posts

Can you tell me how to replace the deprecated warning in PHP 5.5 by replacing preg_replace() with preg_replace_callback() ?

 

account_edit.php (line187)

   
  tep_db_query("UPDATE family_members SET daytime_telephone_ext = '".substr($_POST['family_daytime_telephone_ext'][$key][0],0,6)."', nighttime_telephone_ext = '".substr($_POST['family_nighttime_telephone_ext'][$key][0],0,6)."', first_name = '".preg_replace("/(-)([a-z])/e","'\\1'.strtoupper('\\2')", $_POST['family_firstname'][$key][0])."', tshirt_size = '".$_POST['tshirt_size'][$key][0]."', want_team = '".$_POST['want_team'][$key][0]."', want_telephone_published = '".$_POST['want_telephone_published'][$key][0]."', want_telephone_published2 = '".$_POST['want_telephone_published2'][$key][0]."', last_name = '".preg_replace("/(-)([a-z])/e","'\\1'.strtoupper('\\2')", $_POST['family_lastname'][$key][0])."', address1 = '".$_POST['family_address1'][$key][0]."', address2 = '".$_POST['family_address2'][$key][0]."', city = '".$_POST['family_city'][$key][0]."', date_of_birth = '".tep_date_raw($_POST['family_dob'][$key][0])."', email_address = '".strtolower($_POST['family_email_address'][$key][0])."', daytime_telephone = '".$_POST['family_daytime_telephone'][$key][0]."', nighttime_telephone = '".$_POST['family_nighttime_telephone'][$key][0]."', member_type = '".$member_type."' WHERE member_id = '".$key."'");

and in create_account.php (line 30)

   $lastname = tep_db_prepare_input(preg_replace("/(-)([a-z])/e","'\\1'.strtoupper('\\2')",$HTTP_POST_VARS['lastname']));
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...