Skip to content

Commit

Permalink
refs #1835 : modify - remove every ereg and replace with preg_
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Jan 20, 2016
1 parent 79a306c commit 0e2949c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion library/contrib/phpmailer/class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ function SmtpConnect() {
/* Retry while there is no connection */
while($index < count($hosts) && $connection == false) {
$hostinfo = array();
if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
#if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
if(preg_match("/^(.+):([0-9]+)$/i", $hosts[$index], $hostinfo)) {
$host = $hostinfo[1];
$port = $hostinfo[2];
} else {
Expand Down
8 changes: 5 additions & 3 deletions library/contrib/phpxpath/XPath.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* | What Is XPath:
* | --------------
* | - "What SQL is for a relational database, XPath is for an XML document." -- Sam Blum
* | - "The primary purpose of XPath is to address parts of an XML document. In support of this
* | - "The primary purpose of XPath is to address parts of an XML document. In support of this
* | primary purpose, it also provides basic facilities for manipulting it." -- W3C
* |
* | XPath in action and a very nice intro is under:
Expand Down Expand Up @@ -4456,7 +4456,8 @@ function _handleFunction_starts_with($arguments, $context) {
$first = $this->_handleFunction_string($first, $context);
$second = $this->_handleFunction_string($second, $context);
// Check whether the first string starts with the second one.
return (bool) ereg('^'.$second, $first);
#return (bool) ereg('^'.$second, $first);
return (bool) preg_match("/^".$second."/", $first);
}

/**
Expand Down Expand Up @@ -4713,7 +4714,8 @@ function _handleFunction_lang($arguments, $context) {
// Check whether the node has an language attribute.
if (isSet($currentNode['attributes']['xml:lang'])) {
// Check whether it's the language, the user asks for; if so return TRUE else FALSE
return eregi('^'.$arguments, $currentNode['attributes']['xml:lang']);
#return eregi('^'.$arguments, $currentNode['attributes']['xml:lang']);
return preg_match("/^".$arguments."/i", $currentNode['attributes']['xml:lang']);
}
$currentNode = $currentNode['parentNode']; // Move up to parent
} // End while
Expand Down
4 changes: 0 additions & 4 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,6 @@ function suggestDefaultPort(db) {
count
dechex
dir
ereg
ereg_replace
eregi
eregi_replace
explode
fclose
feof
Expand Down

0 comments on commit 0e2949c

Please sign in to comment.