forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all MDL-20821 Removed more deprecated functions
- Loading branch information
Andrew Davis
committed
Nov 18, 2009
1 parent
e998eff
commit 6959330
Showing
25 changed files
with
794 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
18 Nov 2009 | ||
Description of Bennu modifications to remove functions deprecated as of php 5.3 | ||
|
||
Index: iCalendar_rfc2445.php | ||
=================================================================== | ||
RCS file: /cvsroot/moodle/moodle/lib/bennu/iCalendar_rfc2445.php,v | ||
retrieving revision 1.5 | ||
diff -u -r1.5 iCalendar_rfc2445.php | ||
--- iCalendar_rfc2445.php 4 Nov 2009 20:06:40 -0000 1.5 | ||
+++ iCalendar_rfc2445.php 18 Nov 2009 03:50:16 -0000 | ||
@@ -138,13 +138,13 @@ | ||
} | ||
|
||
if($scheme === 'mailto') { | ||
- $regexp = '^[a-zA-Z0-9]+[_a-zA-Z0-9\-]*(\.[_a-z0-9\-]+)*@(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})$'; | ||
+ $regexp = '#^[a-zA-Z0-9]+[_a-zA-Z0-9\-]*(\.[_a-z0-9\-]+)*@(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})$#'; | ||
} | ||
else { | ||
- $regexp = '^//(.+(:.*)?@)?(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})(:[0-9]{1,5})?(/.*)?$'; | ||
+ $regexp = '#^//(.+(:.*)?@)?(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})(:[0-9]{1,5})?(/.*)?$#'; | ||
} | ||
|
||
- return ereg($regexp, $remain); | ||
+ return preg_match($regexp, $remain); | ||
break; | ||
|
||
case RFC2445_TYPE_BINARY: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
18 Nov 2009 | ||
Description of WriteExcel modifications to remove functions deprecated as of php 5.3 | ||
|
||
Index: Parser.php | ||
=================================================================== | ||
RCS file: /cvsroot/moodle/moodle/lib/excel/Parser.php,v | ||
retrieving revision 1.1 | ||
diff -u -r1.1 Parser.php | ||
--- Parser.php 26 Sep 2003 04:18:02 -0000 1.1 | ||
+++ Parser.php 18 Nov 2009 03:58:49 -0000 | ||
@@ -466,7 +466,7 @@ | ||
{ | ||
return(pack("C", $this->ptg[$token])); | ||
} | ||
- elseif(preg_match("/[A-Z0-9À-Ü\.]+/",$token)) | ||
+ elseif(preg_match("/[A-Z0-9ᅵ-ᅵ\.]+/",$token)) | ||
{ | ||
return($this->_convert_function($token,$this->_func_args)); | ||
} | ||
@@ -723,21 +723,21 @@ | ||
break; | ||
default: | ||
// if it's a reference | ||
- if(eregi("^[A-I]?[A-Z][0-9]+$",$token) and | ||
- !ereg("[0-9]",$this->_lookahead) and | ||
+ if(preg_match("/^[A-I]?[A-Z][0-9]+$/i",$token) and | ||
+ !preg_match("/[0-9]/",$this->_lookahead) and | ||
($this->_lookahead != ':') and ($this->_lookahead != '.')) | ||
{ | ||
return($token); | ||
} | ||
// if it's a range (A1:A2) | ||
- elseif(eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$token) and | ||
- !ereg("[0-9]",$this->_lookahead)) | ||
+ elseif(preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$token) and | ||
+ !preg_match("/[0-9]/",$this->_lookahead)) | ||
{ | ||
return($token); | ||
} | ||
// if it's a range (A1..A2) | ||
- elseif(eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$token) and | ||
- !ereg("[0-9]",$this->_lookahead)) | ||
+ elseif(preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$token) and | ||
+ !preg_match("/[0-9]/",$this->_lookahead)) | ||
{ | ||
return($token); | ||
} | ||
@@ -746,7 +746,7 @@ | ||
return($token); | ||
} | ||
// if it's a function call | ||
- elseif(eregi("^[A-Z0-9À-Ü\.]+$",$token) and ($this->_lookahead == "(")) | ||
+ elseif(preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$token) and ($this->_lookahead == "(")) | ||
|
||
{ | ||
return($token); | ||
@@ -857,15 +857,15 @@ | ||
return($result); | ||
} | ||
// if it's a reference | ||
- if (eregi("^[A-I]?[A-Z][0-9]+$",$this->_current_token)) | ||
+ if (preg_match("/^[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) | ||
{ | ||
$result = $this->_create_tree($this->_current_token, '', ''); | ||
$this->_advance(); | ||
return($result); | ||
} | ||
// if it's a range | ||
- elseif (eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$this->_current_token) or | ||
- eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$this->_current_token)) | ||
+ elseif (preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$this->_current_token) or | ||
+ preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) | ||
{ | ||
$result = $this->_current_token; | ||
$this->_advance(); | ||
@@ -878,7 +878,7 @@ | ||
return($result); | ||
} | ||
// if it's a function call | ||
- elseif (eregi("^[A-Z0-9À-Ü\.]+$",$this->_current_token)) | ||
+ elseif (preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$this->_current_token)) | ||
{ | ||
$result = $this->_func(); | ||
return($result); | ||
Index: Worksheet.php | ||
=================================================================== | ||
RCS file: /cvsroot/moodle/moodle/lib/excel/Worksheet.php,v | ||
retrieving revision 1.1 | ||
diff -u -r1.1 Worksheet.php | ||
--- Worksheet.php 26 Sep 2003 04:18:02 -0000 1.1 | ||
+++ Worksheet.php 18 Nov 2009 03:58:50 -0000 | ||
@@ -1264,10 +1264,10 @@ | ||
} | ||
|
||
// Strip the '=' or '@' sign at the beginning of the formula string | ||
- if (ereg("^=",$formula)) { | ||
+ if (preg_match("/^=/",$formula)) { | ||
$formula = preg_replace("/(^=)/","",$formula); | ||
} | ||
- elseif(ereg("^@",$formula)) { | ||
+ elseif(preg_match("/^@/",$formula)) { | ||
$formula = preg_replace("/(^@)/","",$formula); | ||
} | ||
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
18 Nov 2009 | ||
Description of geoip modifications to remove ereg related functions deprecated as of php 5.3. Patch below. | ||
|
||
Index: geoip.inc | ||
=================================================================== | ||
RCS file: /cvsroot/moodle/moodle/lib/geoip/geoip.inc,v | ||
retrieving revision 1.2 | ||
diff -u -r1.2 geoip.inc | ||
--- geoip.inc 19 Jul 2009 13:54:11 -0000 1.2 | ||
+++ geoip.inc 18 Nov 2009 04:03:48 -0000 | ||
@@ -493,7 +493,7 @@ | ||
$r->nameservers = array("ws1.maxmind.com"); | ||
$p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN"); | ||
$str = is_object($p->answer[0])?$p->answer[0]->string():''; | ||
- ereg("\"(.*)\"",$str,$regs); | ||
+ preg_match("#\"(.*)\"#",$str,$regs); | ||
$str = $regs[1]; | ||
return $str; | ||
} | ||
|
Oops, something went wrong.