From: Simon H. <sim...@us...> - 2010-09-30 16:56:56
|
Update of /cvsroot/stack/stack-dev/lib/CAS In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/CAS Modified Files: casText.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: casText.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/CAS/casText.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** casText.php 18 Feb 2010 11:01:07 -0000 1.39 --- casText.php 30 Sep 2010 16:56:14 -0000 1.40 *************** *** 169,172 **** --- 169,173 ---- function checkValidCASCommands() { + $toReturn = true; foreach($this->cmdArray as $cmd) *************** *** 185,189 **** foreach($this->cmdArray as $cmd) { ! $pat = "|([A-za-z0-9\(\)]+) ([A-za-z0-9\(\)]+)|"; if (preg_match($pat,$cmd)) { --- 186,190 ---- foreach($this->cmdArray as $cmd) { ! $pat = "|([A-Za-z0-9\(\)]+) ([A-Za-z0-9\(\)]+)|"; if (preg_match($pat,$cmd)) { *************** *** 266,270 **** } ! //check final character is not / * + - ^ £ # = & ~ | , ? foreach($this->cmdArray as $cmd) --- 267,271 ---- } ! //check final character is not / * + - ^ £ # = & ~ | , ? : ; foreach($this->cmdArray as $cmd) *************** *** 274,278 **** $lastChar = $cmd[($length -1)]; ! $disallowedChars = array('/','+','*','/','-','^','£','#','~','=','?',',','_','&','"','`','¬'); if(in_array($lastChar, $disallowedChars)) --- 275,279 ---- $lastChar = $cmd[($length -1)]; ! $disallowedChars = array('/','+','*','/','-','^','£','#','~','=','?',',','_','&','"','`','¬',';',':','$'); if(in_array($lastChar, $disallowedChars)) *************** *** 436,443 **** $i++; - $str = new stringUtil($cmd); - $cmd = $str->trimCommands(); - //$cmd = $this->trimCommands($cmd); - unset($str); $this->cmdArray[$label] = $cmd; } --- 437,440 ---- *************** *** 528,534 **** // We assume f and g are single letter functions. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-Za-z])|"; // eg )a if ($this->security == 's') --- 525,531 ---- // We assume f and g are single letter functions. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-DF-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-DF-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-DF-Za-z])|"; // eg )a if ($this->security == 's') *************** *** 536,541 **** // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-Za-eh-z])(\()|"; } --- 533,538 ---- // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-DF-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-DF-Za-eh-z])(\()|"; } *************** *** 598,605 **** { // We assume f and g are single letter functions. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-Za-z])|"; // eg )a if ($this->security == 's') --- 595,603 ---- { // We assume f and g are single letter functions. + // We exclude E (capital eee) to enable 24E+1 to be a floating point number. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-DF-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-DF-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-DF-Za-z])|"; // eg )a if ($this->security == 's') *************** *** 607,612 **** // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-Za-eh-z])(\()|"; } --- 605,610 ---- // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-DF-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-DF-Za-eh-z])(\()|"; } |