$match = explode('.', $row[1]);\r
} else {\r
$output = (function_exists('shell_exec')) ? @shell_exec('mysql -V') : '0.0.0';\r
- preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
+ preg_match('#[0-9]+\.[0-9]+\.[0-9]+#', $output, $version);\r
$match = explode('.', $version[0]);\r
\r
if ($match[0] == '') {\r
array_push($errors, _ERROR3);\r
}\r
\r
- if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix) ) ) {\r
+ if (($mysql_usePrefix == 1) && (!preg_match('#^[a-zA-Z0-9_]+$#', $mysql_prefix) ) ) {\r
array_push($errors, _ERROR4);\r
}\r
\r
* Checks if email address is valid\r
*/\r
function _isValidMailAddress($address) {\r
- if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address) ) {\r
+ if (preg_match("#^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$#", $address) ) {\r
return 1;\r
} else {\r
return 0;\r
// logic: starts and ends with a non space, can contain spaces in between\r
// min 2 chars\r
function _isValidShortName($name) {\r
- if (eregi("^[a-z0-9]+$", $name) ) {\r
+ if (preg_match("#^[a-zA-Z0-9]+$#", $name) ) {\r
return 1;\r
} else {\r
return 0;\r
// returns true if the given string is a valid display name\r
// (to check nicknames)\r
function _isValidDisplayName($name) {\r
- if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name) ) {\r
+ if (preg_match("#^[a-zA-Z0-9]+[a-zA-Z0-9 ]*[a-zA-Z0-9]+$#", $name) ) {\r
return 1;\r
} else {\r
return 0;\r
$result = preg_replace("/([[:space:]]{2,})/", ' ', $result);
/* convert normal boolean operators to shortened syntax */
- $result = eregi_replace(' not ', ' -', $result);
- $result = eregi_replace(' and ', ' ', $result);
- $result = eregi_replace(' or ', ',', $result);
-
+ $result = preg_replace('# not #i', ' -', $result);
+ $result = preg_replace('# and #i', ' ', $result);
+ $result = preg_replace('# or #i', ',', $result);
+
/* strip excessive whitespace */
$result = str_replace(', ', ',', $result);
$result = str_replace(' ,', ',', $result);
return $like;
}
}
-?>
\ No newline at end of file
+?>