Permalink
Browse files

Remove ereg family of functions.

  • Loading branch information...
1 parent 3b62eed commit 416707f8f8e78492bc6e4d680b176186614b55d9 @tpenguin tpenguin committed Apr 28, 2014
Showing with 31 additions and 31 deletions.
  1. +2 −2 htaccess_index.php
  2. +5 −5 plugins/registrar/PLANETDOMAIN.php
  3. +10 −10 plugins/whois/DEFAULT.php
  4. +4 −4 plugins/whois/SUBDOMAIN.php
  5. +10 −10 plugins/whois/WHOIS_CO_ZA.php
View
@@ -111,7 +111,7 @@
if (file_exists($DOCUMENT_ROOT.$REQUEST_URI) &&
($SCRIPT_FILENAME != $DOCUMENT_ROOT.$REQUEST_URI) &&
($REQUEST_URI != "/") &&
- (!ereg( '[////]{2,}$', $REQUEST_URI ) ) )
+ (!preg_match( '@[////]{2,}$@', $REQUEST_URI ) ) )
{
$url = $REQUEST_URI;
@@ -263,4 +263,4 @@ function check_auth($id)
}
ob_end_flush();
-?>
+?>
@@ -106,7 +106,7 @@ function register()
# set the username
$username = trim($domain);
- $username = eregi_replace("[-_\.]", "", $username);
+ $username = preg_replace("/[-_\.]/", "", $username);
if(strlen($username) < $user_len)
{
$rand = md5(md5($username).time());
@@ -158,7 +158,7 @@ function register()
preg_match ("/(user.id=)+([a-zA-Z0-9]){1,30}/i", $result, $arr);
if(is_array($arr) && count($arr) > 0) {
- $id = ereg_replace("user.id=","", $arr[0]);
+ $id = preg_replace("/user.id=/","", $arr[0]);
if(!is_string($id))
return false;
else
@@ -196,7 +196,7 @@ function register()
}
### .au parameters
- elseif (ereg('au', $this->tld))
+ elseif (preg_match('/au/', $this->tld))
{
$vars[] = Array('au.registrant.name', $this->account['first_name'].' '.$this->account['last_name']);
@@ -221,7 +221,7 @@ function register()
$this->debug($vars,$result);
# Result
- if(eregi('success=TRUE', $result))
+ if(preg_match('/success=TRUE/i', $result))
return true;
else
return false;
@@ -262,4 +262,4 @@ function debug($data,$result=false)
}
}
}
-?>
+?>
@@ -24,15 +24,15 @@ function check($domain,$tld,$tld_array)
{
//return true;
// check the domain validity:
- if(!eregi('^[a-zA-Z0-9\-]{1,}$', $domain)) return false;
- if(eregi('[-]{2,}', $domain)) return false;
- if(eregi('^[-]{1,}', $domain)) return false;
- if(eregi('[-]{1,}$', $domain)) return false;
+ if(!preg_match('/^[a-zA-Z0-9\-]{1,}$/i', $domain)) return false;
+ if(preg_match('/[-]{2,}/', $domain)) return false;
+ if(preg_match('/^[-]{1,}/', $domain)) return false;
+ if(preg_match('/[-]{1,}$/', $domain)) return false;
$data = $this->whois($tld_array["whois_server"],$domain . '.' . $tld);
if(!$data) return false;
- if(eregi($tld_array["avail_response"], $data))
+ if(preg_match('/'.$tld_array["avail_response"].'/i', $data))
return true;
else
return false;
@@ -44,15 +44,15 @@ function check_transfer($domain,$tld,$tld_array)
{
//return true;
// check the domain validity:
- if(!eregi('^[a-zA-Z0-9\-]{1,}$', $domain)) return false;
- if(eregi('[-]{2,}', $domain)) return false;
- if(eregi('^[-]{1,}', $domain)) return false;
- if(eregi('[-]{1,}$', $domain)) return false;
+ if(!preg_match('/^[a-zA-Z0-9\-]{1,}$/i', $domain)) return false;
+ if(preg_match('/[-]{2,}/', $domain)) return false;
+ if(preg_match('/^[-]{1,}/', $domain)) return false;
+ if(preg_match('/[-]{1,}$/', $domain)) return false;
$data = $this->whois($tld_array["whois_server"],$domain . '.' . $tld);
if(!$data) return false;
- if(eregi($tld_array["avail_response"], $data))
+ if(preg_match('/'.$tld_array["avail_response"].'/i', $data))
return false;
else
return true;
@@ -23,10 +23,10 @@ class plgn_whois_SUBDOMAIN
function check($domain,$tld,$tld_array)
{
// check the domain validity:
- if(!eregi('^[a-zA-Z0-9\-]{1,}$', $domain)) return false;
- if(eregi('[-]{2,}', $domain)) return false;
- if(eregi('^[-]{1,}', $domain)) return false;
- if(eregi('[-]{1,}$', $domain)) return false;
+ if(!preg_match('/^[a-zA-Z0-9\-]{1,}$/i', $domain)) return false;
+ if(preg_match('/[-]{2,}/', $domain)) return false;
+ if(preg_match('/^[-]{1,}/', $domain)) return false;
+ if(preg_match('/[-]{1,}$/', $domain)) return false;
$db = &DB();
$dbm = new CORE_database;
@@ -24,10 +24,10 @@ function check($domain,$tld,$tld_array)
{
// check the domain validity:
- if(!eregi('^[a-zA-Z0-9\-]{1,}$', $domain)) return false;
- if(eregi('[-]{2,}', $domain)) return false;
- if(eregi('^[-]{1,}', $domain)) return false;
- if(eregi('[-]{1,}$', $domain)) return false;
+ if(!preg_match('/^[a-zA-Z0-9\-]{1,}$/i', $domain)) return false;
+ if(preg_match('/[-]{2,}/', $domain)) return false;
+ if(preg_match('/^[-]{1,}/', $domain)) return false;
+ if(preg_match('/[-]{1,}$/', $domain)) return false;
if($tld != "co.za") return false;
$data = $this->whois( $domain );
@@ -38,10 +38,10 @@ function check($domain,$tld,$tld_array)
function check_transfer($domain,$tld,$tld_array)
{
// check the domain validity:
- if(!eregi('^[a-zA-Z0-9\-]{1,}$', $domain)) return false;
- if(eregi('[-]{2,}', $domain)) return false;
- if(eregi('^[-]{1,}', $domain)) return false;
- if(eregi('[-]{1,}$', $domain)) return false;
+ if(!preg_match('/^[a-zA-Z0-9\-]{1,}$/i', $domain)) return false;
+ if(preg_match('/[-]{2,}/', $domain)) return false;
+ if(preg_match('/^[-]{1,}/', $domain)) return false;
+ if(preg_match('/[-]{1,}$/', $domain)) return false;
if($tld != "co.za") return false;
$data = $this->whois( $domain );
@@ -53,7 +53,7 @@ function whois($domain)
{
$lines = file('http://whois.co.za/cgi-bin/whois.sh?Domain='.$domain);
foreach ($lines as $line_num => $line) {
- if(eregi("Nothing matched", $line)) {
+ if(preg_match("/Nothing matched/i", $line)) {
return true;
}
}
@@ -66,4 +66,4 @@ function details()
return false;
}
}
-?>
+?>

0 comments on commit 416707f

Please sign in to comment.