]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15071 Fixes a regular expression in xmldb_object which breaks sentences with...
authorskodak <skodak>
Sun, 13 Jul 2008 10:52:45 +0000 (10:52 +0000)
committerskodak <skodak>
Sun, 13 Jul 2008 10:52:45 +0000 (10:52 +0000)
lib/xmldb/xmldb_object.php
lib/xmldb/xmldb_statement.php

index ae4a3919a40ce243c516f7525171cee90f7a08c7..a780415bb8247141eb6a10a1670c4b23bf394b1a 100644 (file)
@@ -414,7 +414,7 @@ class xmldb_object {
 
     /// Extract all the quoted elements from the string (skipping 
     /// backslashed quotes that are part of the content.
-        preg_match_all("/('.*?[^\\\]')/is", $string, $matches);
+        preg_match_all("/(''|'.*?[^\\\\]')/is", $string, $matches);
         foreach (array_unique($matches[0]) as $key=>$value) {
             $foundquotes['<%'.$key.'%>'] = $value;
         }
index dea35a86e6b8a3e2c30dbf90b080b3f953a28375..c78bb269fddca74dd1760fd6de36f497d72f829b 100644 (file)
@@ -153,11 +153,13 @@ class xmldb_statement extends xmldb_object {
                     $fields = $this->getFieldsFromInsertSentence($sentence);
                     $values = $this->getValuesFromInsertSentence($sentence);
                 /// Check that we aren't inserting the id field
+/* //ids should be the same when moving database
                     if (in_array('id', $fields)) {
                         $this->errormsg = 'Cannot insert the "id" field. It is an autonumeric column';
                         $this->debug($this->errormsg);
                         $result = false;
                     }
+*/
                     if ($result && count($fields) == 0) {
                         $this->errormsg = 'Missing fields in sentence "' . $sentence . '"';
                         $this->debug($this->errormsg);