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>2018-11-27 18:44:50 +0300
committerWilliam Desportes <williamdes@wdes.fr>2018-11-29 22:19:02 +0300
commit18c23df20f2507a67131ee880bbc35ec29cfeec4 (patch)
tree2b212092a9aec38b4e8f2efe95c9d3effe041288 /libraries
parent8b106a44f9930c157789f93bca50e4ef36a8c221 (diff)
Issue #13032 - fix designer on QA_4_8
Used cherry-pick : Merge pull request #14376 from williamdes/issue-13032-designer Cherry-picked-from: cb2dae58be530cc8d3f64adfb8d871eff6b73fb3 Issue #13032 - fix designer Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/classes/Database/Designer.php16
-rw-r--r--libraries/classes/Database/Designer/Common.php37
2 files changed, 32 insertions, 21 deletions
diff --git a/libraries/classes/Database/Designer.php b/libraries/classes/Database/Designer.php
index 185f35cc37..b013990fa2 100644
--- a/libraries/classes/Database/Designer.php
+++ b/libraries/classes/Database/Designer.php
@@ -151,14 +151,16 @@ class Designer
$display_page
) {
$cfgRelation = $this->relation->getRelationsParam();
+ $designerConfig = new \stdClass();
+ $designerConfig->db = $_GET['db'];
+ $designerConfig->scriptTables = $script_tables;
+ $designerConfig->scriptContr = $script_contr;
+ $designerConfig->server = $GLOBALS['server'];
+ $designerConfig->scriptDisplayField = $script_display_field;
+ $designerConfig->displayPage = $display_page;
+ $designerConfig->tablesEnabled = $cfgRelation['pdfwork'];
return Template::get('database/designer/js_fields')->render([
- 'server' => $GLOBALS['server'],
- 'db' => $_GET['db'],
- 'script_tables' => json_encode($script_tables),
- 'script_contr' => json_encode($script_contr),
- 'script_display_field' => json_encode($script_display_field),
- 'display_page' => $display_page,
- 'relation_pdfwork' => $cfgRelation['pdfwork'],
+ 'designer_config' => json_encode($designerConfig)
]);
}
diff --git a/libraries/classes/Database/Designer/Common.php b/libraries/classes/Database/Designer/Common.php
index 70ecaed7f8..562d35d1df 100644
--- a/libraries/classes/Database/Designer/Common.php
+++ b/libraries/classes/Database/Designer/Common.php
@@ -45,7 +45,15 @@ class Common
$GLOBALS['designer']['TABLE_NAME'] = array();// that foreach no error
$GLOBALS['designer']['OWNER'] = array();
$GLOBALS['designer']['TABLE_NAME_SMALL'] = array();
+ $GLOBALS['designer']['TABLE_TYPE'] = array();
+ $GLOBALS['designer_url']['TABLE_NAME'] = array();
+ $GLOBALS['designer_url']['OWNER'] = array();
+ $GLOBALS['designer_url']['TABLE_NAME_SMALL'] = array();
+
+ $GLOBALS['designer_out']['TABLE_NAME'] = array();
+ $GLOBALS['designer_out']['OWNER'] = array();
+ $GLOBALS['designer_out']['TABLE_NAME_SMALL'] = array();
$tables = $GLOBALS['dbi']->getTablesFull($GLOBALS['db']);
// seems to be needed later
$GLOBALS['dbi']->selectDb($GLOBALS['db']);
@@ -80,7 +88,8 @@ class Common
$DF = $this->relation->getDisplayField($GLOBALS['db'], $one_table['TABLE_NAME']);
if ($DF != '') {
- $retval[$GLOBALS['designer_url']["TABLE_NAME_SMALL"][$i]] = $DF;
+ $DF = rawurlencode((string)$DF);
+ $retval[rawurlencode($GLOBALS['designer_url']["TABLE_NAME_SMALL"][$i])] = $DF;
}
$i++;
@@ -144,12 +153,12 @@ class Common
if ($row !== false) {
foreach ($row as $field => $value) {
$con['C_NAME'][$i] = '';
- $con['DTN'][$i] = urlencode($GLOBALS['db'] . "." . $val[0]);
- $con['DCN'][$i] = urlencode($field);
- $con['STN'][$i] = urlencode(
+ $con['DTN'][$i] = rawurlencode($GLOBALS['db'] . "." . $val[0]);
+ $con['DCN'][$i] = rawurlencode($field);
+ $con['STN'][$i] = rawurlencode(
$value['foreign_db'] . "." . $value['foreign_table']
);
- $con['SCN'][$i] = urlencode($value['foreign_field']);
+ $con['SCN'][$i] = rawurlencode($value['foreign_field']);
$i++;
}
}
@@ -158,15 +167,15 @@ class Common
if ($row !== false) {
foreach ($row['foreign_keys_data'] as $one_key) {
foreach ($one_key['index_list'] as $index => $one_field) {
- $con['C_NAME'][$i] = $one_key['constraint'];
- $con['DTN'][$i] = urlencode($GLOBALS['db'] . "." . $val[0]);
- $con['DCN'][$i] = urlencode($one_field);
- $con['STN'][$i] = urlencode(
+ $con['C_NAME'][$i] = rawurlencode($one_key['constraint']);
+ $con['DTN'][$i] = rawurlencode($GLOBALS['db'] . "." . $val[0]);
+ $con['DCN'][$i] = rawurlencode($one_field);
+ $con['STN'][$i] = rawurlencode(
(isset($one_key['ref_db_name']) ?
$one_key['ref_db_name'] : $GLOBALS['db'])
. "." . $one_key['ref_table_name']
);
- $con['SCN'][$i] = urlencode($one_key['ref_index_list'][$index]);
+ $con['SCN'][$i] = rawurlencode($one_key['ref_index_list'][$index]);
$i++;
}
}
@@ -180,8 +189,8 @@ class Common
$dtn_i = $con['DTN'][$i];
$retval[$ti] = array();
$retval[$ti][$c_name_i] = array();
- if (in_array($dtn_i, $GLOBALS['designer_url']["TABLE_NAME"])
- && in_array($con['STN'][$i], $GLOBALS['designer_url']["TABLE_NAME"])
+ if (in_array(rawurldecode($dtn_i), $GLOBALS['designer_url']["TABLE_NAME"])
+ && in_array(rawurldecode($con['STN'][$i]), $GLOBALS['designer_url']["TABLE_NAME"])
) {
$retval[$ti][$c_name_i][$dtn_i] = array();
$retval[$ti][$c_name_i][$dtn_i][$con['DCN'][$i]] = array(
@@ -248,8 +257,8 @@ class Common
if (Util::isForeignKeySupported($GLOBALS['designer']['TABLE_TYPE'][$i])) {
$j = 1;
}
- $retval['j_tabs'][$GLOBALS['designer_url']['TABLE_NAME'][$i]] = $j;
- $retval['h_tabs'][$GLOBALS['designer_url']['TABLE_NAME'][$i]] = 1;
+ $retval['j_tabs'][\rawurlencode($GLOBALS['designer_url']['TABLE_NAME'][$i])] = $j;
+ $retval['h_tabs'][\rawurlencode($GLOBALS['designer_url']['TABLE_NAME'][$i])] = 1;
}
return $retval;
}