[go: nahoru, domu]

Skip to content

Commit

Permalink
Fixed broken links in setup
Browse files Browse the repository at this point in the history
Fixes #13133

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Mar 30, 2017
1 parent 73ab7f3 commit 8beb7f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ phpMyAdmin - ChangeLog
4.7.1 (not yet released)
- issue #13132 Always execute tracking queries as controluser
- issue #13125 Focus on SQL editor after inserting field name
- issue #13133 Fixed broken links in setup

4.7.0 (2017-03-28)
- patch #12233 [Display] Improve message when renaming database to same name
Expand Down
2 changes: 1 addition & 1 deletion setup/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
// Show generated config file in a <textarea>
//
header('HTTP/1.1 303 See Other');
header('Location: index.php' . URL::getCommonRaw() . '&page=config');
header('Location: index.php' . URL::getCommonRaw(array('page' => 'config')));
exit;
}
9 changes: 3 additions & 6 deletions setup/frames/index.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

/** @var ConfigFile $cf */
$cf = $GLOBALS['ConfigFile'];
$separator = URL::getArgSeparator('html');

// message handling
PMA_messagesBegin();
Expand Down Expand Up @@ -157,12 +156,10 @@
echo '<td>' , htmlspecialchars($cf->getServerDSN($id)) , '</td>';
echo '<td style="white-space: nowrap">';
echo '<small>';
echo '<a href="' , URL::getCommon() , $separator , 'page=servers'
, $separator , 'mode=edit' , $separator , 'id=' , $id , '">'
echo '<a href="' , URL::getCommon(array('page' => 'servers', 'mode' => 'edit', 'id' => $id)), '">'
, __('Edit') , '</a>';
echo ' | ';
echo '<a href="' , URL::getCommon() , $separator , 'page=servers'
, $separator , 'mode=remove' , $separator , 'id=' , $id , '">'
echo '<a href="' , URL::getCommon(array('page' => 'servers', 'mode' => 'remove', 'id' => $id)), '">'
, __('Delete') , '</a>';
echo '</small>';
echo '</td>';
Expand Down Expand Up @@ -270,6 +267,6 @@
echo '<a href="../url.php?url=https://www.phpmyadmin.net/">' , __('phpMyAdmin homepage') , '</a>';
echo '<a href="../url.php?url=https://www.phpmyadmin.net/donate/">'
, __('Donate') , '</a>';
echo '<a href="' , URL::getCommon() , $separator , 'version_check=1">'
echo '<a href="' , URL::getCommon(array('version_check' => '1')), '">'
, __('Check for latest version') , '</a>';
echo '</div>';
15 changes: 6 additions & 9 deletions setup/lib/form_processing.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,18 @@ function PMA_Process_formset(FormDisplay $form_display)
}

// form has errors, show warning
$separator = URL::getArgSeparator('html');
$page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : null;
$formset = isset($_GET['formset']) ? htmlspecialchars($_GET['formset']) : null;
$formset = $formset ? "{$separator}formset=$formset" : '';
$formId = PMA_isValid($_GET['id'], 'numeric') ? $_GET['id'] : null;
$page = isset($_GET['page']) ? $_GET['page'] : '';
$formset = isset($_GET['formset']) ? $_GET['formset'] : '';
$formId = PMA_isValid($_GET['id'], 'numeric') ? $_GET['id'] : '';
if ($formId === null && $page == 'servers') {
// we've just added a new server, get its id
$formId = $form_display->getConfigFile()->getServerCount();
}
$formId = $formId ? "{$separator}id=$formId" : '';
?>
<div class="error">
<h4><?php echo __('Warning') ?></h4>
<?php echo __('Submitted form contains errors') ?><br />
<a href="<?php echo URL::getCommon() , $separator ?>page=<?php echo $page , $formset , $formId , $separator ?>mode=revert">
<a href="<?php echo URL::getCommon(array('page' => $page, 'formset' => $formset, 'id' => $formId, 'mode' => 'revert')) ?>">
<?php echo __('Try to revert erroneous fields to their default values') ?>
</a>
</div>
Expand All @@ -60,7 +57,7 @@ function PMA_Process_formset(FormDisplay $form_display)
<?php echo __('Ignore errors') ?>
</a>
&nbsp;
<a class="btn" href="<?php echo URL::getCommon() , $separator ?>page=<?php echo $page , $formset , $formId , $separator ?>mode=edit">
<a class="btn" href="<?php echo URL::getCommon(array('page' => $page, 'formset' => $formset, 'id' => $formId, 'mode' => 'edit')) ?>">
<?php echo __('Show form') ?>
</a>
<?php
Expand All @@ -82,4 +79,4 @@ function PMA_generateHeader303()
if (!defined('TESTSUITE')) {
exit;
}
}
}

0 comments on commit 8beb7f5

Please sign in to comment.