MrPhil Posted April 25, 2012 Posted April 25, 2012 Everything you need to know: http://us.php.net/manual/en/migration53.deprecated.php $meta_description = ereg_replace('<[^>]*>', '', $product_meta['products_description']); becomes $meta_description = preg_replace('/<[^>]*>/', '', $product_meta['products_description']);
MrPhil Posted April 25, 2012 Posted April 25, 2012 A few depreciated lines I found - errors when using edit orders $city = split (',', $zip_up); becomes either $city = preg_split ('/,/', $zip_up); or $city = explode (',', $zip_up); Likewise, $city = split (',', $zip_up); becomes $city = explode (',', $zip_up); $dept_allow = split("[, ]", $codep['configuration_value']); becomes $dept_allow = preg_split("/[, ]/", $codep['configuration_value']); $country_zones = split("[,]", $countries_table); becomes $country_zones = explode (",", $countries_table); Anyone knows the changes for this? Trivial, aren't they? Use explode() if it's a single fixed character or string, use preg_split() if it's a regular expression.
MrPhil Posted April 25, 2012 Posted April 25, 2012 im lost with the new preg function, can anyone help me with these following statements? if ( eregi('cPath', $params) ){ becomes if ( preg_match('/cPath/i', $params) ){ $pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true' ? "([^[:alnum:]])+" : "([[:punct:]])+"; $anchor = ereg_replace($pattern, '', strtolower($string)); $pattern = "([[:space:]]|[[:blank:]])+"; $anchor = ereg_replace($pattern, '-', $anchor); becomes $pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true' ? "/([^[:alnum:]])+/" : "/([[:punct:]])+/"; $anchor = preg_replace($pattern, '', strtolower($string)); $pattern = "/([[:space:]]|[[:blank:]])+/"; $anchor = preg_replace($pattern, '-', $anchor); case (@eregi("(".@implode('|', $pattern).")", $this->uri)): $this->need_redirect = true; break; case (@eregi("(".@implode('|', $pattern).")", $this->path_info)): becomes case (@preg_match("~(".@implode('|', $pattern).")~i", $this->uri)): $this->need_redirect = true; break; case (@preg_match("~(".@implode('|', $pattern).")~i", $this->path_info)): Note that this assumes that none of the $pattern strings contain a tilde ~. If they do, #, /, ! are alternate delimiters you can use. Worst case, if you have no idea what the $pattern will contain, you will need to add code to scan through $pattern and replace ~ by \~ in the original $pattern. I'm not going any further back in time in this thread. If someone is still waiting for an answer, repost your question.
labmais Posted December 11, 2012 Posted December 11, 2012 Hello, It seems that my website is useless due to some errors. It's impossible to buy products, add to cart, etc, etc. INDEX Accessing the "index" page, I get these errors: Warning: session_save_path() [function.session-save-path]: SAFE MODE Restriction in effect. The script whose uid/gid is 4408/4393 is not allowed to access /tmp owned by uid/gid 0/0 in /includes/functions/sessions.php on line 169 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /includes/functions/sessions.php:169) in /includes/functions/sessions.php on line 102 After some searches I could repair this warnings by changing a row at the table configuration of my DB: Column Column Column FROM: Session Directory SESSION_WRITE_DIRECTORY /tmp TO: Session Directory SESSION_WRITE_DIRECTORY SESSION_WRITE_DIRECTORY BUY NOW When I click the "buy now" button, I get another error: Deprecated: Function ereg() is deprecated in /includes/functions/general.php on line 1096 Warning: Cannot modify header information - headers already sent by (output started at /includes/functions/sessions.php:169) in /includes/functions/general.php on line 36 More searches and I could fix it by replacing the line 1096 like this: FROM: if (ereg('^[0-9]$', $char)) $rand_value .= $char; TO: if (preg_match('{^[0-9]$}', $char)) $rand_value .= $char; My main question is: am I doing the right fixes or have I being lucky till now? The more I fix errors, the more they appear... Is it right? Is my website so out-dated? Thank you E-commerce? No external links please.
♥geoffreywalton Posted December 11, 2012 Posted December 11, 2012 Try looking in the add-ons section and github there are complete lists of all the changes required. HTH G Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
labmais Posted December 11, 2012 Posted December 11, 2012 Try looking in the add-ons section and github there are complete lists of all the changes required. HTH G where is it? E-commerce? No external links please.
♥14steve14 Posted December 11, 2012 Posted December 11, 2012 Try here http://addons.oscommerce.com/info/7394 REMEMBER BACKUP, BACKUP AND BACKUP
Roaddoctor Posted January 5, 2013 Posted January 5, 2013 Could I get a confirmation please, I dont feel like breaking paypal :) if (!ereg("([C-E]{2})-([A-Z0-9]{17})", $_SESSION['paypal_ec_token'])) { becomes if (!preg_match("/([C-E]{2})-([A-Z0-9]{17})/", $_SESSION['paypal_ec_token'])) { cool? -Dave
sunrise99 Posted February 24, 2013 Posted February 24, 2013 Can anyone help me fix this one in headertags.php? $pageName = ucwords(ereg_replace("[^A-Za-z0-9]", " ", $pageName)); Thanks in advance! $pageName = ucwords(preg_replace("/[^A-Za-z0-9]/", " ", $pageName));
tsmit44 Posted March 2, 2013 Posted March 2, 2013 Can someone tell me how i fix this? function makeActiveLink($originalString){ $newString = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\" target=\"_blank\">\\0</a>", $originalString); return $newString; } Thanks in advance!
MrPhil Posted March 3, 2013 Posted March 3, 2013 $newString = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\" target=\"_blank\">\\0</a>", $originalString); becomes $newString = preg_replace("~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~","<a href=\"\\0\" target=\"_blank\">\\0</a>", $originalString);
Peper Posted June 21, 2013 Posted June 21, 2013 Anyone interested, for the tracking module line 74 $text = eregi("$StartGrab(.*)$EndGrab", $grab_data, $content); becomes $text = preg_match("/$StartGrab(.*)$EndGrab/i", $grab_data, $content); Getting the Phoenix off the ground
Recommended Posts
Archived
This topic is now archived and is closed to further replies.