2 Description of WriteExcel modifications to remove functions deprecated as of php 5.3
5 ===================================================================
6 RCS file: /cvsroot/moodle/moodle/lib/excel/Parser.php,v
7 retrieving revision 1.1
8 diff -u -r1.1 Parser.php
9 --- Parser.php 26 Sep 2003 04:18:02 -0000 1.1
10 +++ Parser.php 18 Nov 2009 03:58:49 -0000
13 return(pack("C", $this->ptg[$token]));
\r
15 - elseif(preg_match("/[A-Z0-9À-Ü\.]+/",$token))
\r
16 + elseif(preg_match("/[A-Z0-9ᅵ-ᅵ\.]+/",$token))
\r
18 return($this->_convert_function($token,$this->_func_args));
\r
23 // if it's a reference
\r
24 - if(eregi("^[A-I]?[A-Z][0-9]+$",$token) and
\r
25 - !ereg("[0-9]",$this->_lookahead) and
\r
26 + if(preg_match("/^[A-I]?[A-Z][0-9]+$/i",$token) and
\r
27 + !preg_match("/[0-9]/",$this->_lookahead) and
\r
28 ($this->_lookahead != ':') and ($this->_lookahead != '.'))
\r
32 // if it's a range (A1:A2)
\r
33 - elseif(eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$token) and
\r
34 - !ereg("[0-9]",$this->_lookahead))
\r
35 + elseif(preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$token) and
\r
36 + !preg_match("/[0-9]/",$this->_lookahead))
\r
40 // if it's a range (A1..A2)
\r
41 - elseif(eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$token) and
\r
42 - !ereg("[0-9]",$this->_lookahead))
\r
43 + elseif(preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$token) and
\r
44 + !preg_match("/[0-9]/",$this->_lookahead))
\r
51 // if it's a function call
\r
52 - elseif(eregi("^[A-Z0-9À-Ü\.]+$",$token) and ($this->_lookahead == "("))
\r
53 + elseif(preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$token) and ($this->_lookahead == "("))
\r
60 // if it's a reference
\r
61 - if (eregi("^[A-I]?[A-Z][0-9]+$",$this->_current_token))
\r
62 + if (preg_match("/^[A-I]?[A-Z][0-9]+$/i",$this->_current_token))
\r
64 $result = $this->_create_tree($this->_current_token, '', '');
\r
69 - elseif (eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$this->_current_token) or
\r
70 - eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$this->_current_token))
\r
71 + elseif (preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$this->_current_token) or
\r
72 + preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$this->_current_token))
\r
74 $result = $this->_current_token;
\r
79 // if it's a function call
\r
80 - elseif (eregi("^[A-Z0-9À-Ü\.]+$",$this->_current_token))
\r
81 + elseif (preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$this->_current_token))
\r
83 $result = $this->_func();
\r
86 ===================================================================
87 RCS file: /cvsroot/moodle/moodle/lib/excel/Worksheet.php,v
88 retrieving revision 1.1
89 diff -u -r1.1 Worksheet.php
90 --- Worksheet.php 26 Sep 2003 04:18:02 -0000 1.1
91 +++ Worksheet.php 18 Nov 2009 03:58:50 -0000
92 @@ -1264,10 +1264,10 @@
95 // Strip the '=' or '@' sign at the beginning of the formula string
\r
96 - if (ereg("^=",$formula)) {
\r
97 + if (preg_match("/^=/",$formula)) {
\r
98 $formula = preg_replace("/(^=)/","",$formula);
\r
100 - elseif(ereg("^@",$formula)) {
\r
101 + elseif(preg_match("/^@/",$formula)) {
\r
102 $formula = preg_replace("/(^@)/","",$formula);
\r