Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Desportes <williamdes@wdes.fr>2019-04-28 22:01:36 +0300
committerWilliam Desportes <williamdes@wdes.fr>2019-04-28 22:32:31 +0300
commitca3f027f7e714df46865d8e8393d94ff535a957d (patch)
tree3f9f18448cb7ffdb3a6214e599b63df939306798 /tbl_operations.php
parent14e8d5db7e7ca88c1d30537d773b8ce68ccab369 (diff)
Fix #13178 - Issues with uppercase table and database names
Fixes: #13178 [ci skip] Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'tbl_operations.php')
-rw-r--r--tbl_operations.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tbl_operations.php b/tbl_operations.php
index 0935b9f5d6..4ff5ab9d69 100644
--- a/tbl_operations.php
+++ b/tbl_operations.php
@@ -24,6 +24,15 @@ require_once 'libraries/common.inc.php';
*/
require_once 'libraries/check_user_privileges.inc.php';
+// lower_case_table_names=1 `DB` becomes `db`
+$lowerCaseNames = $GLOBALS['dbi']->getLowerCaseNames() === '1';
+
+if ($lowerCaseNames) {
+ $GLOBALS['table'] = mb_strtolower(
+ $GLOBALS['table']
+ );
+}
+
$pma_table = new Table($GLOBALS['table'], $GLOBALS['db']);
/**
@@ -121,6 +130,12 @@ if (isset($_POST['submitoptions'])) {
$warning_messages = array();
if (isset($_POST['new_name'])) {
+ // lower_case_table_names=1 `DB` becomes `db`
+ if ($lowerCaseNames) {
+ $_POST['new_name'] = mb_strtolower(
+ $_POST['new_name']
+ );
+ }
// Get original names before rename operation
$oldTable = $pma_table->getName();
$oldDb = $pma_table->getDbName();