? config.php ? lib/bennu/readme_moodle.txt ? lib/excel/readme_moodle.txt ? lib/geoip/readme_moodle.txt ? lib/soap/README_MOODLE.txt Index: lib/deprecatedlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/deprecatedlib.php,v retrieving revision 1.184 diff -u -r1.184 deprecatedlib.php --- lib/deprecatedlib.php 7 Nov 2009 16:00:13 -0000 1.184 +++ lib/deprecatedlib.php 18 Nov 2009 05:58:09 -0000 @@ -320,7 +320,7 @@ if (substr_count($string, '..') > $allowdots) { // Sometimes we allow dots in references return true; } - if (ereg('[\|\`]', $string)) { // check for other bad characters + if (preg_match('/[\|\`]/', $string)) { // check for other bad characters return true; } if (empty($string) or $string == '/') { Index: lib/filelib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/filelib.php,v retrieving revision 1.167 diff -u -r1.167 filelib.php --- lib/filelib.php 13 Nov 2009 08:51:49 -0000 1.167 +++ lib/filelib.php 18 Nov 2009 05:58:13 -0000 @@ -1193,7 +1193,7 @@ global $CFG; $mimeinfo = get_mimetypes_array(); - if (eregi('\.([a-z0-9]+)$', $filename, $match)) { + if (preg_match('/\.([a-z0-9]+)$/i', $filename, $match)) { if (isset($mimeinfo[strtolower($match[1])][$element])) { return $mimeinfo[strtolower($match[1])][$element]; } else { Index: lib/validateurlsyntax.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/validateurlsyntax.php,v retrieving revision 1.8 diff -u -r1.8 validateurlsyntax.php --- lib/validateurlsyntax.php 1 Nov 2009 11:31:17 -0000 1.8 +++ lib/validateurlsyntax.php 18 Nov 2009 05:58:32 -0000 @@ -174,7 +174,7 @@ // $options = strtolower($options); // Check Options Parameter - if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options )) + if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options )) { trigger_error("Options attribute malformed", E_USER_ERROR); } @@ -315,7 +315,7 @@ // echo '
' . htmlentities(wordwrap($regexp,70,"\n",1)) . ''; // Running the regular expression - if (eregi( $regexp, $urladdr )) + if (preg_match( preg_quote($regexp,'/'), $urladdr )) { return true; // The domain passed } @@ -377,7 +377,7 @@ function validateEmailSyntax( $emailaddr, $options="" ){ // Check Options Parameter - if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options )) + if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options )) { trigger_error("Options attribute malformed", E_USER_ERROR); } @@ -485,7 +485,7 @@ function validateFtpSyntax( $ftpaddr, $options="" ){ // Check Options Parameter - if (!ereg( '^([sHSEFuPaIpfqr][+?-])*$', $options )) + if (!preg_match( '/^([sHSEFuPaIpfqr][+?-])*$/', $options )) { trigger_error("Options attribute malformed", E_USER_ERROR); } Index: lib/webdavlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/webdavlib.php,v retrieving revision 1.3 diff -u -r1.3 webdavlib.php --- lib/webdavlib.php 26 May 2009 06:26:11 -0000 1.3 +++ lib/webdavlib.php 18 Nov 2009 05:58:33 -0000 @@ -178,7 +178,7 @@ $regs = array(); /* [1] [2] [3] [4] [5] [6] */ - if (ereg('^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$', $iso8601, $regs)) { + if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/', $iso8601, $regs)) { return mktime($regs[4],$regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); } // to be done: regex for partial-time...apache webdav mod never returns partial-time Index: lib/weblib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v retrieving revision 1.1347 diff -u -r1.1347 weblib.php --- lib/weblib.php 18 Nov 2009 00:57:05 -0000 1.1347 +++ lib/weblib.php 18 Nov 2009 05:58:34 -0000 @@ -736,11 +736,11 @@ */ function validate_email($address) { - return (ereg('^[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+'. - '(\.[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+)*'. + return (preg_match('#^[-!\#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+'. + '(\.[-!\#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+)*'. '@'. - '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'. - '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', + '[-!\#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'. + '[-!\#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$#', $address)); } Index: lib/wiki_to_markdown.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/wiki_to_markdown.php,v retrieving revision 1.16 diff -u -r1.16 wiki_to_markdown.php --- lib/wiki_to_markdown.php 17 Nov 2009 01:36:35 -0000 1.16 +++ lib/wiki_to_markdown.php 18 Nov 2009 05:58:35 -0000 @@ -229,7 +229,7 @@ // MARKDOWN: no change so leave // is this a list line (starts with * # ; :) - if (eregi( "^([*]+|[#]+|[;]+|[:]+) ", $line )) { + if (preg_match( "/^([*]+|[#]+|[;]+|[:]+) /i", $line )) { $line = $this->do_list( $line ); } @@ -331,7 +331,7 @@ // run through lines foreach( $lines as $line ) { // is this a blank line? - $blank_line = eregi( "^[[:blank:]\r]*$", $line ); + $blank_line = preg_match( "/^[[:blank:]\r]*$/i", $line ); if ($blank_line) { // first end current block according to state $buffer = $buffer . $this->close_block( $this->block_state ); @@ -342,13 +342,13 @@ // act now depending on current block state if ($this->block_state == STATE_NONE) { // first character of line defines block type - if (eregi( "^> ",$line )) { + if (preg_match( "/^> /i",$line )) { // blockquote $buffer = $buffer . $this->line_replace( $line ). "\n"; $this->block_state = STATE_BLOCKQUOTE; } else - if (eregi( "^ ",$line) ) { + if (preg_match( "/^ /i",$line) ) { // preformatted text // MARKDOWN: no real equiv. so just use
$buffer = $buffer . "\n"; @@ -356,7 +356,7 @@ $this->block_state = STATE_PREFORM; } else - if (eregi("^\% ",$line) ) { + if (preg_match("/^\% /i",$line) ) { // preformatted text - no processing // MARKDOWN: this is MD code form of a paragraph $buffer = $buffer . " " . preg_replace( "/^\%/i","",$line) . "\n"; Index: lib/bennu/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 --- lib/bennu/iCalendar_rfc2445.php 4 Nov 2009 20:06:40 -0000 1.5 +++ lib/bennu/iCalendar_rfc2445.php 18 Nov 2009 05:58:49 -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: Index: lib/excel/Parser.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/excel/Parser.php,v retrieving revision 1.1 diff -u -r1.1 Parser.php --- lib/excel/Parser.php 26 Sep 2003 04:18:02 -0000 1.1 +++ lib/excel/Parser.php 18 Nov 2009 05:59:03 -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: lib/excel/Worksheet.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/excel/Worksheet.php,v retrieving revision 1.1 diff -u -r1.1 Worksheet.php --- lib/excel/Worksheet.php 26 Sep 2003 04:18:02 -0000 1.1 +++ lib/excel/Worksheet.php 18 Nov 2009 05:59:04 -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 { Index: lib/geoip/geoip.inc =================================================================== RCS file: /cvsroot/moodle/moodle/lib/geoip/geoip.inc,v retrieving revision 1.2 diff -u -r1.2 geoip.inc --- lib/geoip/geoip.inc 19 Jul 2009 13:54:11 -0000 1.2 +++ lib/geoip/geoip.inc 18 Nov 2009 05:59:07 -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; } Index: lib/pear/README_MOODLE.txt =================================================================== RCS file: /cvsroot/moodle/moodle/lib/pear/README_MOODLE.txt,v retrieving revision 1.3 diff -u -r1.3 README_MOODLE.txt --- lib/pear/README_MOODLE.txt 20 May 2009 06:35:46 -0000 1.3 +++ lib/pear/README_MOODLE.txt 18 Nov 2009 05:59:14 -0000 @@ -28,3 +28,127 @@ Example: /usr/bin/php lib/pear/PHP/runsniffer mod/forum + +18 Nov 2009 +Description of modifications to remove ereg related functions deprecated as of php 5.3. Patch below. + +Index: Spreadsheet/Excel/Writer/Parser.php +=================================================================== +RCS file: /cvsroot/moodle/moodle/lib/pear/Spreadsheet/Excel/Writer/Parser.php,v +retrieving revision 1.2 +diff -u -r1.2 Parser.php +--- Spreadsheet/Excel/Writer/Parser.php 4 Jan 2006 08:23:42 -0000 1.2 ++++ Spreadsheet/Excel/Writer/Parser.php 18 Nov 2009 04:11:09 -0000 +@@ -1206,7 +1206,7 @@ + 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 != '!')) + { +@@ -1214,39 +1214,39 @@ + } + // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1) + elseif (preg_match("/^\w+(\:\w+)?\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and +- !ereg("[0-9]",$this->_lookahead) and ++ !preg("/[0-9]/",$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("/^'[\w -]+(\:[\w -]+)?'\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and +- !ereg("[0-9]",$this->_lookahead) and ++ !preg("/[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!A1 or Sheet1:Sheet2!A1:B2 + elseif (preg_match("/^\w+(\:\w+)?\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and +- !ereg("[0-9]",$this->_lookahead)) ++ !preg_match("/[0-9]/",$this->_lookahead)) + { + return $token; + } + // If it's an external range like 'Sheet1'!A1 or 'Sheet1:Sheet2'!A1:B2 + elseif (preg_match("/^'[\w -]+(\:[\w -]+)?'\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and +- !ereg("[0-9]",$this->_lookahead)) ++ !preg_match("/[0-9]/",$this->_lookahead)) + { + return $token; + } +@@ -1258,12 +1258,12 @@ + 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; + } +@@ -1363,7 +1363,7 @@ + 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; +@@ -1521,7 +1521,7 @@ + return $result; + } + // if it's a function call +- elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$this->_current_token)) ++ elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/",$this->_current_token)) + { + $result = $this->_func(); + return $result; +Index: XML/Parser.php +=================================================================== +RCS file: /cvsroot/moodle/moodle/lib/pear/XML/Parser.php,v +retrieving revision 1.1 +diff -u -r1.1 Parser.php +--- XML/Parser.php 22 Jun 2009 18:35:56 -0000 1.1 ++++ XML/Parser.php 18 Nov 2009 04:11:10 -0000 +@@ -417,7 +417,7 @@ + /** + * check, if file is a remote file + */ +- if (eregi('^(http|ftp)://', substr($file, 0, 10))) { ++ if (preg_match('#^(http|ftp)://#i', substr($file, 0, 10))) { + if (!ini_get('allow_url_fopen')) { + return $this-> + raiseError('Remote files cannot be parsed, as safe mode is enabled.', +@@ -474,7 +474,7 @@ + if (is_resource($fp)) { + $this->fp = $fp; + return true; +- } elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) { ++ } elseif (preg_match('#^[a-z]+://#i', substr($fp, 0, 10))) { + // see if it's an absolute URL (has a scheme at the beginning) + return $this->setInputFile($fp); + } elseif (file_exists($fp)) { Index: lib/pear/Spreadsheet/Excel/Writer/Parser.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/pear/Spreadsheet/Excel/Writer/Parser.php,v retrieving revision 1.2 diff -u -r1.2 Parser.php --- lib/pear/Spreadsheet/Excel/Writer/Parser.php 4 Jan 2006 08:23:42 -0000 1.2 +++ lib/pear/Spreadsheet/Excel/Writer/Parser.php 18 Nov 2009 05:59:18 -0000 @@ -1206,7 +1206,7 @@ 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 != '!')) { @@ -1214,39 +1214,39 @@ } // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1) elseif (preg_match("/^\w+(\:\w+)?\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and - !ereg("[0-9]",$this->_lookahead) and + !preg("/[0-9]/",$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("/^'[\w -]+(\:[\w -]+)?'\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and - !ereg("[0-9]",$this->_lookahead) and + !preg("/[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!A1 or Sheet1:Sheet2!A1:B2 elseif (preg_match("/^\w+(\:\w+)?\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and - !ereg("[0-9]",$this->_lookahead)) + !preg_match("/[0-9]/",$this->_lookahead)) { return $token; } // If it's an external range like 'Sheet1'!A1 or 'Sheet1:Sheet2'!A1:B2 elseif (preg_match("/^'[\w -]+(\:[\w -]+)?'\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and - !ereg("[0-9]",$this->_lookahead)) + !preg_match("/[0-9]/",$this->_lookahead)) { return $token; } @@ -1258,12 +1258,12 @@ 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; } @@ -1363,7 +1363,7 @@ 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; @@ -1521,7 +1521,7 @@ return $result; } // if it's a function call - elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$this->_current_token)) + elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/",$this->_current_token)) { $result = $this->_func(); return $result; Index: lib/pear/XML/Parser.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/pear/XML/Parser.php,v retrieving revision 1.1 diff -u -r1.1 Parser.php --- lib/pear/XML/Parser.php 22 Jun 2009 18:35:56 -0000 1.1 +++ lib/pear/XML/Parser.php 18 Nov 2009 05:59:18 -0000 @@ -417,7 +417,7 @@ /** * check, if file is a remote file */ - if (eregi('^(http|ftp)://', substr($file, 0, 10))) { + if (preg_match('#^(http|ftp)://#i', substr($file, 0, 10))) { if (!ini_get('allow_url_fopen')) { return $this-> raiseError('Remote files cannot be parsed, as safe mode is enabled.', @@ -474,7 +474,7 @@ if (is_resource($fp)) { $this->fp = $fp; return true; - } elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) { + } elseif (preg_match('#^[a-z]+://#i', substr($fp, 0, 10))) { // see if it's an absolute URL (has a scheme at the beginning) return $this->setInputFile($fp); } elseif (file_exists($fp)) { Index: lib/soap/nusoap.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/soap/nusoap.php,v retrieving revision 1.2 diff -u -r1.2 nusoap.php --- lib/soap/nusoap.php 3 Jan 2007 14:44:42 -0000 1.2 +++ lib/soap/nusoap.php 18 Nov 2009 05:59:30 -0000 @@ -503,7 +503,7 @@ case (is_array($val) || $type): // detect if struct or array $valueType = $this->isArraySimpleOrStruct($val); - if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){ + if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){ $i = 0; if(is_array($val) && count($val)> 0){ foreach($val as $v){ @@ -698,7 +698,7 @@ */ function expandQname($qname){ // get element prefix - if(strpos($qname,':') && !ereg('^http://',$qname)){ + if(strpos($qname,':') && !preg_match('#^http://#',$qname)){ // get unqualified name $name = substr(strstr($qname,':'),1); // get ns prefix @@ -826,7 +826,8 @@ function timestamp_to_iso8601($timestamp,$utc=true){ $datestr = date('Y-m-d\TH:i:sO',$timestamp); if($utc){ - $eregStr = + $regStr = + '/'. '([0-9]{4})-'. // centuries & years CCYY- '([0-9]{2})-'. // months MM- '([0-9]{2})'. // days DD @@ -834,9 +835,10 @@ '([0-9]{2}):'. // hours hh: '([0-9]{2}):'. // minutes mm: '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss... - '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's + '(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's + '/'; - if(ereg($eregStr,$datestr,$regs)){ + if(preg_match($eregStr,$datestr,$regs)){ return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]); } return false; @@ -852,7 +854,8 @@ * @access public */ function iso8601_to_timestamp($datestr){ - $eregStr = + $regStr = + '/'. '([0-9]{4})-'. // centuries & years CCYY- '([0-9]{2})-'. // months MM- '([0-9]{2})'. // days DD @@ -860,8 +863,9 @@ '([0-9]{2}):'. // hours hh: '([0-9]{2}):'. // minutes mm: '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss... - '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's - if(ereg($eregStr,$datestr,$regs)){ + '(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's + '/'; + if(preg_match($regStr,$datestr,$regs)){ // not utc if($regs[8] != 'Z'){ $op = substr($regs[8],0,1); @@ -1171,7 +1175,7 @@ if(count($attrs) > 0){ foreach($attrs as $k => $v){ // if ns declarations, add to class level array of valid namespaces - if(ereg("^xmlns",$k)){ + if(preg_match("/^xmlns/",$k)){ //$this->xdebug("$k: $v"); //$this->xdebug('ns_prefix: '.$this->getPrefix($k)); if($ns_prefix = substr(strrchr($k,':'),1)){ @@ -1281,7 +1285,7 @@ // minOccurs="0" maxOccurs="unbounded" /> // // - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){ + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){ $this->xdebug('complexType is unusual array'); $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; } else { @@ -1300,7 +1304,7 @@ // minOccurs="0" maxOccurs="unbounded" /> // // - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){ + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){ $this->xdebug('complexType is unusual array'); $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; } else { @@ -1698,7 +1702,7 @@ } elseif(isset($this->attributes[$type])){ $this->xdebug("in getTypeDef, found attribute $type"); return $this->attributes[$type]; - } elseif (ereg('_ContainedType$', $type)) { + } elseif (preg_match('/_ContainedType$/', $type)) { $this->xdebug("in getTypeDef, have an untyped element $type"); $typeDef['typeClass'] = 'simpleType'; $typeDef['phpType'] = 'scalar'; @@ -2041,7 +2045,7 @@ function soap_transport_http($url){ parent::nusoap_base(); $this->setURL($url); - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev); + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')'; $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']); } @@ -2580,7 +2584,7 @@ } } // remove 100 header - if(isset($lb) && ereg('^HTTP/1.1 100',$data)){ + if(isset($lb) && preg_match('/^HTTP/1.1 100/',$data)){ unset($lb); $data = ''; }// @@ -2733,7 +2737,7 @@ curl_close($this->ch); // remove 100 header(s) - while (ereg('^HTTP/1.1 100',$data)) { + while (preg_match('#^HTTP/1.1 100#',$data)) { if ($pos = strpos($data,"\r\n\r\n")) { $data = ltrim(substr($data,$pos)); } elseif($pos = strpos($data,"\n\n") ) { @@ -3267,7 +3271,7 @@ } $this->debug("In service, query string=$qs"); - if (ereg('wsdl', $qs) ){ + if (preg_match('/wsdl/', $qs) ){ $this->debug("In service, this is a request for WSDL"); if($this->externalWSDLURL){ if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL @@ -3338,7 +3342,7 @@ // get the character encoding of the incoming request if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3367,7 +3371,7 @@ $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3401,7 +3405,7 @@ $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3730,7 +3734,7 @@ $payload .= $this->getDebugAsXMLComment(); } $this->outgoing_headers[] = "Server: $this->title Server v$this->version"; - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev); + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")"; // Let the Web server decide about this //$this->outgoing_headers[] = "Connection: Close\r\n"; @@ -3818,7 +3822,7 @@ if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -4336,7 +4340,7 @@ $this->currentSchema->schemaStartElement($parser, $name, $attrs); $this->appendDebug($this->currentSchema->getDebug()); $this->currentSchema->clearDebug(); - } elseif (ereg('schema$', $name)) { + } elseif (preg_match('/schema$/', $name)) { $this->debug('Parsing WSDL schema'); // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")"); $this->status = 'schema'; @@ -4355,7 +4359,7 @@ if (count($attrs) > 0) { // register namespace declarations foreach($attrs as $k => $v) { - if (ereg("^xmlns", $k)) { + if (preg_match("/^xmlns/", $k)) { if ($ns_prefix = substr(strrchr($k, ':'), 1)) { $this->namespaces[$ns_prefix] = $v; } else { @@ -4380,7 +4384,7 @@ $attrs = array(); } // get element prefix, namespace and name - if (ereg(':', $name)) { + if (preg_match('/:/', $name)) { // get ns prefix $prefix = substr($name, 0, strpos($name, ':')); // get ns @@ -4545,7 +4549,7 @@ */ function end_element($parser, $name){ // unset schema status - if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) { + if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) { $this->status = ""; $this->appendDebug($this->currentSchema->getDebug()); $this->currentSchema->clearDebug(); @@ -5995,7 +5999,7 @@ $key_localpart = $this->getLocalPart($key); // if ns declarations, add to class level array of valid namespaces if($key_prefix == 'xmlns'){ - if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){ + if(preg_match('#^http://www.w3.org/[0-9]{4}/XMLSchema$#',$value)){ $this->XMLSchemaVersion = $value; $this->namespaces['xsd'] = $this->XMLSchemaVersion; $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance'; @@ -6031,8 +6035,8 @@ [5] length ::= nextDimension* Digit+ [6] nextDimension ::= Digit+ ',' */ - $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]'; - if(ereg($expr,$value,$regs)){ + $expr = '/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/'; + if(preg_match($expr,$value,$regs)){ $this->message[$pos]['typePrefix'] = $regs[1]; $this->message[$pos]['arrayTypePrefix'] = $regs[1]; if (isset($this->namespaces[$regs[1]])) { @@ -6758,7 +6762,7 @@ // detect transport switch(true){ // http(s) - case ereg('^http',$this->endpoint): + case preg_match('/^http/',$this->endpoint): $this->debug('transporting via HTTP'); if($this->persistentConnection == true && is_object($this->persistentConnection)){ $http =& $this->persistentConnection; @@ -6780,10 +6784,10 @@ $http->setEncoding($this->http_encoding); } $this->debug('sending message, length='.strlen($msg)); - if(ereg('^http:',$this->endpoint)){ + if(preg_match('/^http:/',$this->endpoint)){ //if(strpos($this->endpoint,'http:')){ $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies); - } elseif(ereg('^https',$this->endpoint)){ + } elseif(preg_match('/^https/',$this->endpoint)){ //} elseif(strpos($this->endpoint,'https:')){ //if(phpversion() == '4.3.0-dev'){ //$response = $http->send($msg,$timeout,$response_timeout); @@ -6841,7 +6845,7 @@ if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; Index: lib/tcpdf/README-MOODLE.TXT =================================================================== RCS file: /cvsroot/moodle/moodle/lib/tcpdf/README-MOODLE.TXT,v retrieving revision 1.2 diff -u -r1.2 README-MOODLE.TXT --- lib/tcpdf/README-MOODLE.TXT 20 Jul 2009 17:31:48 -0000 1.2 +++ lib/tcpdf/README-MOODLE.TXT 18 Nov 2009 05:59:31 -0000 @@ -29,3 +29,24 @@ accessible directly. However, it doesn't seem to be used within the library code. + + +18 Nov 2009 +Description of modifications to remove ereg related functions deprecated as of php 5.3. Patch below. + +Index: tcpdf.php +=================================================================== +RCS file: /cvsroot/moodle/moodle/lib/tcpdf/tcpdf.php,v +retrieving revision 1.3 +diff -u -r1.3 tcpdf.php +--- tcpdf.php 20 Jul 2009 17:31:48 -0000 1.3 ++++ tcpdf.php 18 Nov 2009 05:48:56 -0000 +@@ -7595,7 +7595,7 @@ + if (isset($dash)) { + $dash_string = ''; + if ($dash) { +- if (ereg('^.+,', $dash)) { ++ if (preg_match('/^.+,/', $dash)) { + $tab = explode(',', $dash); + } else { + $tab = array($dash); Index: lib/tcpdf/tcpdf.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/tcpdf/tcpdf.php,v retrieving revision 1.3 diff -u -r1.3 tcpdf.php --- lib/tcpdf/tcpdf.php 20 Jul 2009 17:31:48 -0000 1.3 +++ lib/tcpdf/tcpdf.php 18 Nov 2009 05:59:37 -0000 @@ -7595,7 +7595,7 @@ if (isset($dash)) { $dash_string = ''; if ($dash) { - if (ereg('^.+,', $dash)) { + if (preg_match('/^.+,/', $dash)) { $tab = explode(',', $dash); } else { $tab = array($dash); Index: lib/typo3/class.t3lib_cs.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/typo3/class.t3lib_cs.php,v retrieving revision 1.10 diff -u -r1.10 class.t3lib_cs.php --- lib/typo3/class.t3lib_cs.php 17 Nov 2009 01:36:35 -0000 1.10 +++ lib/typo3/class.t3lib_cs.php 18 Nov 2009 05:59:37 -0000 @@ -987,13 +987,13 @@ // Detect type if not done yet: (Done on first real line) // The "whitespaced" type is on the syntax "0x0A 0x000A #LINE FEED" while "ms-token" is like "B9 = U+00B9 : SUPERSCRIPT ONE" - if (!$detectedType) $detectedType = ereg('[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+',$value) ? 'whitespaced' : 'ms-token'; + if (!$detectedType) $detectedType = preg_match('/[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+/',$value) ? 'whitespaced' : 'ms-token'; if ($detectedType=='ms-token') { list($hexbyte,$utf8) = split('=|:',$value,3); } elseif ($detectedType=='whitespaced') { $regA=array(); - ereg('[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+',$value,$regA); + preg_match('/[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+/',$value,$regA); $hexbyte = $regA[1]; $utf8 = 'U+'.$regA[2]; } @@ -1097,7 +1097,7 @@ // accented Latin letters without "official" decomposition $match = array(); - if (ereg('^LATIN (SMALL|CAPITAL) LETTER ([A-Z]) WITH',$name,$match) && !$decomp) { + if (preg_match('/^LATIN (SMALL|CAPITAL) LETTER ([A-Z]) WITH/',$name,$match) && !$decomp) { $c = ord($match[2]); if ($match[1] == 'SMALL') $c += 32; @@ -1106,7 +1106,7 @@ } $match = array(); - if (ereg('(<.*>)? *(.+)',$decomp,$match)) { + if (preg_match('/(<.*>)? *(.+)/',$decomp,$match)) { switch($match[1]) { case '': // add parenthesis as circle replacement, eg (1) $match[2] = '0028 '.$match[2].' 0029'; @@ -1117,7 +1117,7 @@ break; case ' ': // ignore multi char decompositions that start with a space - if (ereg('^0020 ',$match[2])) continue 2; + if (preg_match('/^0020 /',$match[2])) continue 2; break; // ignore Arabic and vertical layout presentation decomposition Index: lib/typo3/class.t3lib_div.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/typo3/class.t3lib_div.php,v retrieving revision 1.5 diff -u -r1.5 class.t3lib_div.php --- lib/typo3/class.t3lib_div.php 17 Nov 2009 01:36:35 -0000 1.5 +++ lib/typo3/class.t3lib_div.php 18 Nov 2009 05:59:40 -0000 @@ -1063,7 +1063,7 @@ */ public static function split_fileref($fileref) { $reg = array(); - if ( ereg('(.*/)(.*)$',$fileref,$reg) ) { + if ( preg_match('#(.*/)(.*)$#',$fileref,$reg) ) { $info['path'] = $reg[1]; $info['file'] = $reg[2]; } else { @@ -1071,7 +1071,7 @@ $info['file'] = $fileref; } $reg=''; - if ( ereg('(.*)\.([^\.]*$)',$info['file'],$reg) ) { + if ( preg_match('#(.*)\.([^\.]*$)#',$info['file'],$reg) ) { $info['filebody'] = $reg[1]; $info['fileext'] = strtolower($reg[2]); $info['realFileext'] = $reg[2]; @@ -1423,7 +1423,7 @@ if (strpos($email,' ') !== false) { return false; } - return ereg('^[A-Za-z0-9\._-]+[@][A-Za-z0-9\._-]+[\.].[A-Za-z0-9]+$',$email) ? TRUE : FALSE; + return preg_match('/^[A-Za-z0-9\._-]+[@][A-Za-z0-9\._-]+[\.].[A-Za-z0-9]+$/',$email) ? TRUE : FALSE; } /** @@ -2713,7 +2713,7 @@ // Checking if the "subdir" is found: $subdir = substr($fI['dirname'],strlen($dirName)); if ($subdir) { - if (ereg('^[[:alnum:]_]+\/$',$subdir) || ereg('^[[:alnum:]_]+\/[[:alnum:]_]+\/$',$subdir)) { + if (preg_match('#^[[:alnum:]_]+\/$#',$subdir) || preg_match('#^[[:alnum:]_]+\/[[:alnum:]_]+\/$#',$subdir)) { $dirName.= $subdir; if (!@is_dir($dirName)) { t3lib_div::mkdir_deep(PATH_site.'typo3temp/', $subdir); @@ -3785,7 +3785,7 @@ */ public static function verifyFilenameAgainstDenyPattern($filename) { if (strcmp($filename,'') && strcmp($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'],'')) { - $result = eregi($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'],$filename); + $result = preg_match('/'.$GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'].'/i',$filename); if ($result) return false; // so if a matching filename is found, return false; } return true; @@ -5103,12 +5103,12 @@ if($quoteActive > -1) { $paramsArr[$quoteActive] .= ' '.$v; unset($paramsArr[$k]); - if(ereg('"$', $v)) { $quoteActive = -1; } + if(preg_match('/"$/', $v)) { $quoteActive = -1; } } elseif(!trim($v)) { unset($paramsArr[$k]); // Remove empty elements - } elseif(ereg('^"', $v)) { + } elseif(preg_match('/^"/', $v)) { $quoteActive = $k; } } Index: lib/typo3/readme_moodle.txt =================================================================== RCS file: /cvsroot/moodle/moodle/lib/typo3/readme_moodle.txt,v retrieving revision 1.2 diff -u -r1.2 readme_moodle.txt --- lib/typo3/readme_moodle.txt 1 Nov 2009 15:42:34 -0000 1.2 +++ lib/typo3/readme_moodle.txt 18 Nov 2009 05:59:41 -0000 @@ -2,3 +2,126 @@ skodak, stronk7 + + +18 Nov 2009 +Description of modifications to remove ereg related functions deprecated as of php 5.3. Patch below. + +Index: class.t3lib_cs.php +=================================================================== +RCS file: /cvsroot/moodle/moodle/lib/typo3/class.t3lib_cs.php,v +retrieving revision 1.10 +diff -u -r1.10 class.t3lib_cs.php +--- class.t3lib_cs.php 17 Nov 2009 01:36:35 -0000 1.10 ++++ class.t3lib_cs.php 18 Nov 2009 05:51:54 -0000 +@@ -987,13 +987,13 @@ + + // Detect type if not done yet: (Done on first real line) + // The "whitespaced" type is on the syntax "0x0A 0x000A #LINE FEED" while "ms-token" is like "B9 = U+00B9 : SUPERSCRIPT ONE" +- if (!$detectedType) $detectedType = ereg('[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+',$value) ? 'whitespaced' : 'ms-token'; ++ if (!$detectedType) $detectedType = preg_match('/[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+/',$value) ? 'whitespaced' : 'ms-token'; + + if ($detectedType=='ms-token') { + list($hexbyte,$utf8) = split('=|:',$value,3); + } elseif ($detectedType=='whitespaced') { + $regA=array(); +- ereg('[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+',$value,$regA); ++ preg_match('/[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+/',$value,$regA); + $hexbyte = $regA[1]; + $utf8 = 'U+'.$regA[2]; + } +@@ -1097,7 +1097,7 @@ + + // accented Latin letters without "official" decomposition + $match = array(); +- if (ereg('^LATIN (SMALL|CAPITAL) LETTER ([A-Z]) WITH',$name,$match) && !$decomp) { ++ if (preg_match('/^LATIN (SMALL|CAPITAL) LETTER ([A-Z]) WITH/',$name,$match) && !$decomp) { + $c = ord($match[2]); + if ($match[1] == 'SMALL') $c += 32; + +@@ -1106,7 +1106,7 @@ + } + + $match = array(); +- if (ereg('(<.*>)? *(.+)',$decomp,$match)) { ++ if (preg_match('/(<.*>)? *(.+)/',$decomp,$match)) { + switch($match[1]) { + case ' ': // add parenthesis as circle replacement, eg (1) + $match[2] = '0028 '.$match[2].' 0029'; +@@ -1117,7 +1117,7 @@ + break; + + case ' ': // ignore multi char decompositions that start with a space +- if (ereg('^0020 ',$match[2])) continue 2; ++ if (preg_match('/^0020 /',$match[2])) continue 2; + break; + + // ignore Arabic and vertical layout presentation decomposition +Index: class.t3lib_div.php +=================================================================== +RCS file: /cvsroot/moodle/moodle/lib/typo3/class.t3lib_div.php,v +retrieving revision 1.5 +diff -u -r1.5 class.t3lib_div.php +--- class.t3lib_div.php 17 Nov 2009 01:36:35 -0000 1.5 ++++ class.t3lib_div.php 18 Nov 2009 05:51:59 -0000 +@@ -1063,7 +1063,7 @@ + */ + public static function split_fileref($fileref) { + $reg = array(); +- if ( ereg('(.*/)(.*)$',$fileref,$reg) ) { ++ if ( preg_match('#(.*/)(.*)$#',$fileref,$reg) ) { + $info['path'] = $reg[1]; + $info['file'] = $reg[2]; + } else { +@@ -1071,7 +1071,7 @@ + $info['file'] = $fileref; + } + $reg=''; +- if ( ereg('(.*)\.([^\.]*$)',$info['file'],$reg) ) { ++ if ( preg_match('#(.*)\.([^\.]*$)#',$info['file'],$reg) ) { + $info['filebody'] = $reg[1]; + $info['fileext'] = strtolower($reg[2]); + $info['realFileext'] = $reg[2]; +@@ -1423,7 +1423,7 @@ + if (strpos($email,' ') !== false) { + return false; + } +- return ereg('^[A-Za-z0-9\._-]+[@][A-Za-z0-9\._-]+[\.].[A-Za-z0-9]+$',$email) ? TRUE : FALSE; ++ return preg_match('/^[A-Za-z0-9\._-]+[@][A-Za-z0-9\._-]+[\.].[A-Za-z0-9]+$/',$email) ? TRUE : FALSE; + } + + /** +@@ -2713,7 +2713,7 @@ + // Checking if the "subdir" is found: + $subdir = substr($fI['dirname'],strlen($dirName)); + if ($subdir) { +- if (ereg('^[[:alnum:]_]+\/$',$subdir) || ereg('^[[:alnum:]_]+\/[[:alnum:]_]+\/$',$subdir)) { ++ if (preg_match('#^[[:alnum:]_]+\/$#',$subdir) || preg_match('#^[[:alnum:]_]+\/[[:alnum:]_]+\/$#',$subdir)) { + $dirName.= $subdir; + if (!@is_dir($dirName)) { + t3lib_div::mkdir_deep(PATH_site.'typo3temp/', $subdir); +@@ -3785,7 +3785,7 @@ + */ + public static function verifyFilenameAgainstDenyPattern($filename) { + if (strcmp($filename,'') && strcmp($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'],'')) { +- $result = eregi($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'],$filename); ++ $result = preg_match('/'.$GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'].'/i',$filename); + if ($result) return false; // so if a matching filename is found, return false; + } + return true; +@@ -5103,12 +5103,12 @@ + if($quoteActive > -1) { + $paramsArr[$quoteActive] .= ' '.$v; + unset($paramsArr[$k]); +- if(ereg('"$', $v)) { $quoteActive = -1; } ++ if(preg_match('/"$/', $v)) { $quoteActive = -1; } + + } elseif(!trim($v)) { + unset($paramsArr[$k]); // Remove empty elements + +- } elseif(ereg('^"', $v)) { ++ } elseif(preg_match('/^"/', $v)) { + $quoteActive = $k; + } + } + Index: mnet/xmlrpc/server.php =================================================================== RCS file: /cvsroot/moodle/moodle/mnet/xmlrpc/server.php,v retrieving revision 1.41 diff -u -r1.41 server.php --- mnet/xmlrpc/server.php 1 Nov 2009 12:25:58 -0000 1.41 +++ mnet/xmlrpc/server.php 18 Nov 2009 05:59:47 -0000 @@ -314,7 +314,7 @@ global $MNET_REMOTE_CLIENT; if (is_object($MNET_REMOTE_CLIENT->object_to_call)) { - return @call_user_method_array($functionname, $MNET_REMOTE_CLIENT->object_to_call, $argsarray); + return @call_user_func_array(array($MNET_REMOTE_CLIENT->object_to_call,$functionname), $argsarray); } else if (!empty($MNET_REMOTE_CLIENT->static_location)) { return @call_user_func_array(array($MNET_REMOTE_CLIENT->static_location, $functionname), $argsarray); } else { Index: mod/wiki/ewiki/fragments/nuke_mod_wiki_index =================================================================== RCS file: /cvsroot/moodle/moodle/mod/wiki/ewiki/fragments/nuke_mod_wiki_index,v retrieving revision 1.2 diff -u -r1.2 nuke_mod_wiki_index --- mod/wiki/ewiki/fragments/nuke_mod_wiki_index 4 Nov 2009 19:53:02 -0000 1.2 +++ mod/wiki/ewiki/fragments/nuke_mod_wiki_index 18 Nov 2009 06:00:54 -0000 @@ -15,7 +15,7 @@ #-- stupid legacy code -if (!eregi("modules.php", $PHP_SELF)) { +if (!preg_match("/modules.php/i", $PHP_SELF)) { die ("You can't access this file directly..."); }