Remove some deprecated ereg functions

This commit is contained in:
Nathan Gray 2011-03-09 18:18:26 +00:00
parent bc39d9ab5b
commit bd03ec245f

View File

@ -191,7 +191,7 @@ class importexport_helper_functions {
* category isn't found, it will be automaticaly added. * category isn't found, it will be automaticaly added.
* *
* Patterns as well as the replacement can be regular expressions (the replacement is done * Patterns as well as the replacement can be regular expressions (the replacement is done
* via ereg_replace). * via str_replace).
* *
* @param array _record reference with record to do the conversion with * @param array _record reference with record to do the conversion with
* @param array _conversion array with conversion description * @param array _conversion array with conversion description
@ -238,12 +238,12 @@ class importexport_helper_functions {
} }
$c_functions = implode('|', $c_functions); $c_functions = implode('|', $c_functions);
foreach ( $rvalues as $pattern => $replace ) { foreach ( $rvalues as $pattern => $replace ) {
if( ereg( (string)$pattern, $val) ) { if( preg_match('/'. (string)$pattern.'/', $val) ) {
$val = ereg_replace( (string)$pattern, $replace, (string)$val ); $val = preg_replace( '/'.(string)$pattern.'/', $replace, (string)$val );
$reg = '\|\[([a-zA-Z_0-9]+)\]'; $reg = '/\|\[([a-zA-Z_0-9]+)\]/';
while( ereg( $reg, $val, $vars ) ) { while( preg_match( $reg, $val, $vars ) ) {
// expand all _record fields // expand all _record fields
$val = str_replace( $val = str_replace(
$CPre . $vars[1] . $CPos, $CPre . $vars[1] . $CPos,