|
|
|
@ -40,7 +40,7 @@ function _is_valid($string, $min_length, $max_length, $regex) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Does the string entirely consist of characters of $type? |
|
|
|
|
if (!eregi("^$regex$", $string)) { |
|
|
|
|
if (!preg_match("^$regex$", $string)) { |
|
|
|
|
return(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -135,7 +135,7 @@ function contains_bad_words($string) {
|
|
|
|
|
|
|
|
|
|
function contains_phone_number($string) { |
|
|
|
|
// Check for phone number |
|
|
|
|
if (ereg("[[:digit:]]{3,10}[\. /\)\(-]*[[:digit:]]{6,10}", $string)) { |
|
|
|
|
if (preg_match("[[:digit:]]{3,10}[\. /\)\(-]*[[:digit:]]{6,10}", $string)) { |
|
|
|
|
return(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|