diff options
Diffstat (limited to 'application/controllers')
-rw-r--r-- | application/controllers/file.php | 6 | ||||
-rw-r--r-- | application/controllers/tools.php | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php index a78f89bb0..f484c5260 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -684,10 +684,10 @@ class File extends MY_Controller { ->from('files') ->join('file_storage', 'file_storage.id = files.file_storage_id') ->where(' - (user = '.$this->db->escape($user).') + (files.user = '.$this->db->escape($user).') AND ( - mimetype LIKE "image%" - OR mimetype IN ("application/pdf") + mimetype LIKE \'image%\' + OR mimetype IN (\'application/pdf\') )', null, false) ->order_by('date', 'desc') ->get()->result_array(); diff --git a/application/controllers/tools.php b/application/controllers/tools.php index f0d8ce6f9..664a9e324 100644 --- a/application/controllers/tools.php +++ b/application/controllers/tools.php @@ -59,9 +59,14 @@ class Tools extends MY_Controller { return; } - $this->db->query('SET FOREIGN_KEY_CHECKS = 0'); + + if ($this->db->dbdriver !== 'postgre') { + $this->db->query('SET FOREIGN_KEY_CHECKS = 0'); + } $this->db->query('DROP TABLE '.implode(", ", $tables_to_drop)); - $this->db->query('SET FOREIGN_KEY_CHECKS = 1'); + if ($this->db->dbdriver !== 'postgre') { + $this->db->query('SET FOREIGN_KEY_CHECKS = 1'); + } } function test() |