Use URL::getCommon() for all params to be included in the urls

Don't append the parameters in query string while building the HTML; was going awry when URL::getCommon() returned blank

Fix #12463
More instances of such appending of URL parameters which are present in the codebase,
have to fixed.

ChangeLog entry for #12463

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
This commit is contained in:
Deven Bansod 2016-08-17 12:09:01 +05:30
parent f22b1e8bbb
commit 44760aca0b
6 changed files with 29 additions and 17 deletions

View File

@ -23,6 +23,7 @@ phpMyAdmin - ChangeLog
- issue Removed MySQL connection retry without password
- issue #12218 Allow to specify further parameters for control connection
- issue #12162 Show charset for each table on Database structure page
- issue #12463 Incorrect link in the href of icon at Hide/Show unhide links
4.6.5 (not yet released)
- issue Remove potentionally license problematic sRGB profile

View File

@ -522,6 +522,9 @@ $(function () {
event.preventDefault();
$.ajax({
type: 'POST',
data: {
token: PMA_commonParams.get('token')
},
url: $(this).attr('href') + '&ajax_request=true',
success: function (data) {
if (typeof data !== 'undefined' && data.success === true) {
@ -570,6 +573,9 @@ $(function () {
var $msg = PMA_ajaxShowMessage();
$.ajax({
type: 'POST',
data: {
token: PMA_commonParams.get('token')
},
url: $(this).attr('href') + '&ajax_request=true',
success: function (data) {
PMA_ajaxRemoveMessage($msg);

View File

@ -220,10 +220,6 @@ class URL
$params['collation_connection'] = $GLOBALS['collation_connection'];
}
if (empty($params)) {
return '';
}
return $divider . http_build_query($params, null, $separator);
}

View File

@ -207,14 +207,17 @@ class Navigation
$html .= '<table width="100%"><tbody>';
$odd = true;
foreach ($hidden[$t] as $hiddenItem) {
$params = array(
'unhideNavItem' => true,
'itemType' => $t,
'itemName' => $hiddenItem,
'dbName' => $dbName
);
$html .= '<tr class="' . ($odd ? 'odd' : 'even') . '">';
$html .= '<td>' . htmlspecialchars($hiddenItem) . '</td>';
$html .= '<td style="width:80px"><a href="navigation.php'
. URL::getCommon()
. '&unhideNavItem=true'
. '&itemType=' . urlencode($t)
. '&itemName=' . urlencode($hiddenItem)
. '&dbName=' . urlencode($dbName) . '"'
. URL::getCommon($params) . '"'
. ' class="unhideNavItem ajax">'
. Util::getIcon('show.png', __('Show'))
. '</a></td>';

View File

@ -687,11 +687,13 @@ class NodeDatabase extends Node
$cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['navwork']) {
if ($this->hiddenCount > 0) {
$params = array(
'showUnhideDialog' => true,
'dbName' => $this->real_name,
);
$ret = '<span class="dbItemControls">'
. '<a href="navigation.php'
. URL::getCommon()
. '&showUnhideDialog=true'
. '&dbName=' . urlencode($this->real_name) . '"'
. URL::getCommon($params) . '"'
. ' class="showUnhide ajax">'
. Util::getImage(
'show.png',

View File

@ -38,13 +38,17 @@ abstract class NodeDatabaseChild extends Node
if ($cfgRelation['navwork']) {
$db = $this->realParent()->real_name;
$item = $this->real_name;
$params = array(
'hideNavItem' => true,
'itemType' => $this->getItemType(),
'itemName' => $item,
'dbName' => $db
);
$ret = '<span class="navItemControls">'
. '<a href="navigation.php'
. URL::getCommon()
. '&hideNavItem=true'
. '&itemType=' . urlencode($this->getItemType())
. '&itemName=' . urlencode($item)
. '&dbName=' . urlencode($db) . '"'
. URL::getCommon($params) . '"'
. ' class="hideNavItem ajax">'
. PMA\libraries\Util::getImage('hide.png', __('Hide'))
. '</a></span>';