]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 enforce prefix for native pg driver
authorskodak <skodak>
Tue, 2 Dec 2008 10:07:03 +0000 (10:07 +0000)
committerskodak <skodak>
Tue, 2 Dec 2008 10:07:03 +0000 (10:07 +0000)
lib/dml/pgsql_native_moodle_database.php

index 35e8dff3bdfe594e5aeb4f220133dcbe8dd72a8e..4208542e97668c583736c57e26a8780d12363efe 100644 (file)
@@ -84,6 +84,11 @@ class pgsql_native_moodle_database extends moodle_database {
      * @throws dml_connection_exception if error
      */
     public function connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, array $dboptions=null) {
+        if ($prefix == '' and !$this->external) {
+            //Enforce prefixes for everybody but mysql
+            throw new dml_exception('prefixcannotbeempty', $this->get_dbfamily());
+        }
+
         $driverstatus = $this->driver_installed();
 
         if ($driverstatus !== true) {