summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-11-03 15:14:38 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2014-11-03 15:14:38 +0100
commita63b9b546c699e1f14ed26e18834b163360ba2c8 (patch)
tree55a9d7e5027a9e8818343ff2a7d8bdd39599c5df
parentf513432a35246a6b9b20c9077cfd7b80aac50150 (diff)
Add plugin hook 'db_table_name' as requested in #1489837
-rw-r--r--program/lib/Roundcube/rcube_db.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php
index 1e6a206da..5a76f69c7 100644
--- a/program/lib/Roundcube/rcube_db.php
+++ b/program/lib/Roundcube/rcube_db.php
@@ -1063,6 +1063,10 @@ class rcube_db
*/
public function table_name($table, $quoted = false)
{
+ // let plugins alter the table name (#1489837)
+ $plugin = rcube::get_instance()->plugins->exec_hook('db_table_name', array('table' => $table));
+ $table = $plugin['table'];
+
// add prefix to the table name if configured
if (($prefix = $this->options['table_prefix']) && strpos($table, $prefix) !== 0) {
$table = $prefix . $table;