From: cajus Date: Tue, 26 Jan 2010 09:40:08 +0000 (+0000) Subject: Removed deprecated ereg functions X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2189e330111acb3f8829b1655ee994035b2fb799;p=gosa.git Removed deprecated ereg functions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15301 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/html/index.php b/gosa-core/html/index.php index 8b7852860..ebae5e52f 100644 --- a/gosa-core/html/index.php +++ b/gosa-core/html/index.php @@ -295,7 +295,7 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces $ok= true; if (!$htaccess_authenticated){ $username= $_POST["username"]; - if (!ereg("^[@A-Za-z0-9_.-]+$", $username)){ + if (!preg_match("/^[@A-Za-z0-9_.-]+$/", $username)){ $message= _("Please specify a valid username!"); $ok= false; } elseif (mb_strlen($_POST["password"], 'UTF-8') == 0){ diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 17acd751d..1f2baab3e 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -210,7 +210,7 @@ class LDAP{ } else { $basedn = LDAP::convert($basedn); } - return(ereg_replace("[^,]*[,]*[ ]*(.*)", "\\1", $basedn)); + return(preg_replace("/[^,]*[,]*[ ]*(.*)/", "$1", $basedn)); } @@ -1012,7 +1012,7 @@ class LDAP{ /* Append lines ... */ if(!empty($tmp2)) { /* check if we need base64_decode for this line */ - if(ereg("::",$tmp2)) + if(strstr($tmp2, "::") !== false) { $encoded = explode("::",$entry); $attr = trim($encoded[0]); diff --git a/gosa-core/include/utils/excel/class.writeexcel_formula.inc.php b/gosa-core/include/utils/excel/class.writeexcel_formula.inc.php index 79a1129ac..f761b74e3 100644 --- a/gosa-core/include/utils/excel/class.writeexcel_formula.inc.php +++ b/gosa-core/include/utils/excel/class.writeexcel_formula.inc.php @@ -996,35 +996,35 @@ function _match($token) { default: // if it's a reference if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$token) and - !ereg("[0-9]",$this->_lookahead) and + !preg_match("/[0-9]/",$this->_lookahead) and ($this->_lookahead != ':') and ($this->_lookahead != '.') and ($this->_lookahead != '!')) { return $token; } // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1) elseif (preg_match("/^[A-Za-z0-9_]+(\:[A-Za-z0-9_]+)?\![A-Ia-i]?[A-Za-z][0-9]+$/",$token) and - !ereg("[0-9]",$this->_lookahead) and + !preg_match("/[0-9]/",$this->_lookahead) and ($this->_lookahead != ':') and ($this->_lookahead != '.')) { return $token; } // if it's a range (A1:A2) elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and - !ereg("[0-9]",$this->_lookahead)) { + !preg_match("/[0-9]/",$this->_lookahead)) { return $token; } // if it's a range (A1..A2) elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and - !ereg("[0-9]",$this->_lookahead)) { + !preg_match("/[0-9]/",$this->_lookahead)) { return $token; } // If it's an external range like Sheet1:Sheet2!A1:B2 elseif (preg_match("/^[A-Za-z0-9_]+(\:[A-Za-z0-9_]+)?\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/",$token) and - !ereg("[0-9]",$this->_lookahead)) { + !preg_match("/[0-9]/",$this->_lookahead)) { return $token; } // If it's an external range like 'Sheet1:Sheet2'!A1:B2 elseif (preg_match("/^'[A-Za-z0-9_ ]+(\:[A-Za-z0-9_ ]+)?'\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/",$token) and - !ereg("[0-9]",$this->_lookahead)) { + !preg_match("/[0-9]/",$this->_lookahead)) { return $token; } // If it's a number (check that it's not a sheet name or range) @@ -1034,11 +1034,11 @@ function _match($token) { return $token; } // If it's a string (of maximum 255 characters) - elseif (ereg("^\"[^\"]{0,255}\"$",$token)) { + elseif (preg_match("/^\"[^\"]{0,255}\"$/",$token)) { return $token; } // if it's a function call - elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$token) and ($this->_lookahead == "(")) { + elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$token) and ($this->_lookahead == "(")) { return $token; } return ''; @@ -1129,7 +1129,7 @@ function _condition() { */ function _expression() { // If it's a string return a string node - if (ereg("^\"[^\"]{0,255}\"$", $this->_current_token)) { + if (preg_match("/^\"[^\"]{0,255}\"$/", $this->_current_token)) { $result = $this->_createTree($this->_current_token, '', ''); $this->_advance(); return $result; @@ -1255,7 +1255,7 @@ function _fact() { $result = $this->_createTree($this->_current_token, '', ''); $this->_advance(); return $result; - } elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$this->_current_token)) { + } elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$this->_current_token)) { // if it's a function call $result = $this->_func(); return $result; diff --git a/gosa-plugins/mail/personal/mail/sieve/class_semantics.inc b/gosa-plugins/mail/personal/mail/sieve/class_semantics.inc index 1c00051c0..8c6d05f02 100644 --- a/gosa-plugins/mail/personal/mail/sieve/class_semantics.inc +++ b/gosa-plugins/mail/personal/mail/sieve/class_semantics.inc @@ -454,7 +454,7 @@ class Semantics } // Check if command may appear here - if (!ereg($this->s_['valid_after'], $prev)) + if (strstr($prev, $this->s_['valid_after'] === false)) { # $this->message = 'line '. $line .': "'. $this->command_ .'" may not appear after "'. $prev .'"'; # return false; diff --git a/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc b/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc index 22b02e48a..cab0fdd34 100644 --- a/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc +++ b/gosa-plugins/mail/personal/mail/sieve/class_sieve.inc @@ -301,7 +301,7 @@ class sieve //response. They repsond as follows: "Cyrus timsieved v1.0.0" "SASL={PLAIN,........}" //So, if we see IMLEMENTATION in the first line, then we are done. - if(ereg("IMPLEMENTATION",$this->line)) + if(strstr($this->line, "IMPLEMENTATION")) { //we're on the Cyrus V2 sieve server while(sieve::status($this->line) == F_DATA){