mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-14 20:16:50 +01:00
Fix bug where listing tables in PostgreSQL database with db_prefix didn't work (#7093)
This commit is contained in:
@@ -26,6 +26,7 @@ CHANGELOG Roundcube Webmail
|
||||
- Fix so displayed maximum attachment size depends also on 'max_message_size' (#7105)
|
||||
- Fix bug where 'skins_allowed' option didn't enforce user skin preference (#7080)
|
||||
- Fix so contact's organization field accepts up to 128 characters (it was 50)
|
||||
- Fix bug where listing tables in PostgreSQL database with db_prefix didn't work (#7093)
|
||||
|
||||
RELEASE 1.4.1
|
||||
-------------
|
||||
|
||||
@@ -191,9 +191,8 @@ class rcube_db_pgsql extends rcube_db
|
||||
{
|
||||
// get tables if not cached
|
||||
if ($this->tables === null) {
|
||||
if ($schema = $this->options['table_prefix']) {
|
||||
$schema = str_replace('.', '', $schema);
|
||||
$add = " AND TABLE_SCHEMA = " . $this->quote($schema);
|
||||
if (($schema = $this->options['table_prefix']) && $schema[strlen($schema)-1] === '.') {
|
||||
$add = " AND TABLE_SCHEMA = " . $this->quote(substr($schema, 0, -1));
|
||||
}
|
||||
else {
|
||||
$add = " AND TABLE_SCHEMA NOT IN ('pg_catalog', 'information_schema')";
|
||||
@@ -220,9 +219,9 @@ class rcube_db_pgsql extends rcube_db
|
||||
{
|
||||
$args = array($table);
|
||||
|
||||
if ($schema = $this->options['table_prefix']) {
|
||||
if (($schema = $this->options['table_prefix']) && $schema[strlen($schema)-1] === '.') {
|
||||
$add = " AND TABLE_SCHEMA = ?";
|
||||
$args[] = str_replace('.', '', $schema);
|
||||
$args[] = substr($schema, 0, -1);
|
||||
}
|
||||
else {
|
||||
$add = " AND TABLE_SCHEMA NOT IN ('pg_catalog', 'information_schema')";
|
||||
|
||||
Reference in New Issue
Block a user