Некоторые изменения в коде OSCommerce при переходе на PHP 5.3
На самом деле там исправлений коде OSCommerce при переходе на PHP 5.3 намного больше, но это тоже должно кому-нибудь помочь.
Можете прогнать рекурсивным поиском на вхождения слов ereg, split
$title=ereg_replace(" ", "+", $itemurl); $title=preg_replace("/ /", "+", $itemurl); if (!ereg('^[[:alnum:]]+[[:alnum:].]+$', $name)) { if (!preg_match('#^[[:alnum:]]+[[:alnum:].]+$#', $name)) { if (!@ereg('^[[:alnum:]]+[[:alnum:].]+$', $name)) { if (!@preg_match('#^[[:alnum:]]+[[:alnum:].]+$#', $name)) { $string = ereg_replace(' +', ' ', trim($string)); $string = preg_replace('{ +}', ' ', trim($string)); ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037))) preg_replace('{2037\z}', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037))) ereg_replace('"', ' ', $pieces[$k]) str_replace('"', ' ', $pieces[$k]) |
Продолжение изменений
ereg_replace('(' . implode('|', $from) . ')', $to, $string) preg_replace('{(' . implode('|', $from) . ')}', $to, $string) ereg_replace('[^0-9]', '', $number) preg_replace('{\D}', '', $number) ereg_replace('-language', '-' . $languages[$j]['directory'], $cached_file) str_replace('-language', '-' . $languages[$j]['directory'], $cached_file) ereg_replace("\r","",$which_text) str_replace("\r","",$which_text) ereg_replace('-language', '-' . $language, $cache_blocks[$i]['file']) str_replace('-language', '-' . $language, $cache_blocks[$i]['file']) ereg_replace(",\n$", '', $schema) preg_replace("{,\n\z}", '', $schema) ereg_replace("\n#", "\n".'\#', $row) preg_replace("{\n#}", "\n".'\#', $row) ereg_replace(', $', '', $schema) preg_replace('{, \z}', '', $schema) $pieces = split('[[:space:]]+', $search_str) $pieces = preg_split("/[\s,]+/", $search_str); if (ereg('->', $use_function)) { if (preg_match('{->}', $use_function)) { if (ereg('^[0-9]$', $char)) $rand_value .= $char; if (preg('/^[0-9]$/', $char)) $rand_value .= $char; if (ereg('^[0-9]$', $char)) $rand_value .= $char; if (preg_match('^[0-9]$', $char)) $rand_value .= $char; ereg('\.([^\.]*$)', $this->file_src_name, $extension); preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension); ereg_replace('[^A-Za-z0-9_]', '', $this->file_dst_name_body); preg_replace('/[^A-Za-z0-9_]/', '', $this->file_dst_name_body); eregi('\.([^\.]*$)', $this->file_src_name, $extension); preg_match('/\.([^\.]*$)/i', $this->file_src_name, $extension); ereg($startreg['format'], $date, $regs); preg_match('/'.$startreg['format'].'/', $date, $regs); eregi ("\@.()+_*^%$#\.[;]", $branchname) preg_match('/\@.()+_*^%$#\.[;]/i', 'your_second_arument', $branchname) if (eregi($Match, $_SERVER['HTTP_USER_AGENT'])) if (preg_match('/$Match/i',$_SERVER['HTTP_USER_AGENT'])) if (!eregi('^' . DIR_FS_DOCUMENT_ROOT, $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT if (!preg_match('#^' . DIR_FS_DOCUMENT_ROOT.'#i', $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT; if (!ereg('^' . DIR_FS_DOCUMENT_ROOT, $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT; if (!preg_match('/'.'^' . str_replace('/','\\/',DIR_FS_DOCUMENT_ROOT) .'/', $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT; $string = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$string); $string = preg_replace("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/i","",$string) ereg(‘^([^=]*)=["\']?([^"\']*)["\']?$’,$v,$a3) preg_match(‘/^([^=]*)=["\']?([^"\']*)["\']?$/’, $v, $a3) ereg(‘^([^=]*)=["\']?([^"\']*)["\']?$’,$v,$a3) preg_match(‘/^([^=]*)=["\']?([^"\']*)["\']?$/’, $v, $a3) ereg('([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?',$lang,$found); preg_match_all('/([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?/', $lang, $found); |
Как вариант конечно остаться на PHP 5.2.17, но там уже найдено много уязвимостей и хостеры скоро отойдут от PHP 5.2