aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/tools
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2017-05-21 15:59:59 +0200
committerMarc Alexander <admin@m-a-styles.de>2017-05-21 16:01:27 +0200
commitbcc85ab679f6f100d169597990a8ab4138dd3158 (patch)
tree342efcb874be8c728fde40e30e9db197dd283f47 /phpBB/phpbb/db/tools
parent11f968e774fed238030f851c4ad90facf86e583f (diff)
downloadforums-bcc85ab679f6f100d169597990a8ab4138dd3158.tar
forums-bcc85ab679f6f100d169597990a8ab4138dd3158.tar.gz
forums-bcc85ab679f6f100d169597990a8ab4138dd3158.tar.bz2
forums-bcc85ab679f6f100d169597990a8ab4138dd3158.tar.xz
forums-bcc85ab679f6f100d169597990a8ab4138dd3158.zip
[ticket/14992] Correctly remove table name and prefix from keys
PHPBB3-14992
Diffstat (limited to 'phpBB/phpbb/db/tools')
-rw-r--r--phpBB/phpbb/db/tools/tools.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/phpBB/phpbb/db/tools/tools.php b/phpBB/phpbb/db/tools/tools.php
index 112438fcdd..76036554d2 100644
--- a/phpBB/phpbb/db/tools/tools.php
+++ b/phpBB/phpbb/db/tools/tools.php
@@ -947,7 +947,19 @@ class tools implements tools_interface
case 'oracle':
case 'sqlite3':
$index_name = $this->check_index_name_length($table_name, $table_name . '_' . $index_name, false);
- $row[$col] = strpos($row[$col], $table_name) === 0 ? substr($row[$col], strlen($table_name) + 1) : $row[$col];
+ $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
+
+ if (strpos($index_name , $table_name) === false)
+ {
+ if (strpos($index_name, $table_prefix) !== false)
+ {
+ $row[$col] = substr($row[$col], strlen($table_prefix) + 1);
+ }
+ else
+ {
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ }
+ }
break;
}