From: skodak Date: Tue, 2 Dec 2008 10:07:03 +0000 (+0000) Subject: MDL-14679 enforce prefix for native pg driver X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=189f3ee9bf0d2a6a4c02e506a3afb65b1b9c8fce;p=moodle.git MDL-14679 enforce prefix for native pg driver --- diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index 35e8dff3bd..4208542e97 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -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) {