]> git.mjollnir.org Git - moodle.git/commitdiff
DB escaping comments. MDL-8918
authorstronk7 <stronk7>
Thu, 15 Mar 2007 19:03:07 +0000 (19:03 +0000)
committerstronk7 <stronk7>
Thu, 15 Mar 2007 19:03:07 +0000 (19:03 +0000)
Merged from MOODLE_18_STABLE

lib/xmldb/classes/generators/mysql/mysql.class.php
lib/xmldb/classes/generators/oci8po/oci8po.class.php
lib/xmldb/classes/generators/postgres7/postgres7.class.php

index 30967ab54693157a5d6d16b4baa716de83bd0694..2d0c5546dc9cd7b301bbc296f053ad3cea9d9115 100644 (file)
@@ -238,7 +238,7 @@ class XMLDBmysql extends XMLDBGenerator {
 
         if ($xmldb_table->getComment()) {
             $comment .= 'ALTER TABLE ' . $this->getTableName($xmldb_table);
-            $comment .= " COMMENT='" . substr($xmldb_table->getComment(), 0, 60) . "'";
+            $comment .= " COMMENT='" . addslashes(substr($xmldb_table->getComment(), 0, 60)) . "'";
         }
         return array($comment);
     }
index 7f380b565f9cc99d8083c04f0eb6344be038dbd5..9b872c4ba1d1a145331467eff549b2557913c4e4 100644 (file)
@@ -198,7 +198,7 @@ class XMLDBoci8po extends XMLDBgenerator {
     function getCommentSQL ($xmldb_table) {
 
         $comment = "COMMENT ON TABLE " . $this->getTableName($xmldb_table);
-        $comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'";
+        $comment.= " IS '" . addslashes(substr($xmldb_table->getComment(), 0, 250)) . "'";
 
         return array($comment);
     }
index 6f401fbdc23ced23279c8efd1e9d78f675a15e61..4bb95921c5d8d8d09768aed49430f994be28bcd6 100644 (file)
@@ -135,7 +135,7 @@ class XMLDBpostgres7 extends XMLDBgenerator {
     function getCommentSQL ($xmldb_table) {
 
         $comment = "COMMENT ON TABLE " . $this->getTableName($xmldb_table);
-        $comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'";
+        $comment.= " IS '" . addslashes(substr($xmldb_table->getComment(), 0, 250)) . "'";
 
         return array($comment);
     }