fixed URL generation where needed only & and not &

This commit is contained in:
Michal Čihař
2003-01-08 14:43:55 +00:00
parent 1bb107dc8c
commit c54073dafc
8 changed files with 17 additions and 17 deletions

View File

@@ -33,7 +33,7 @@ if (!isset($is_db) || !$is_db) {
$is_db = @PMA_mysql_select_db($db); $is_db = @PMA_mysql_select_db($db);
} }
if (empty($db) || !$is_db) { if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url() . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit();
} }
} // end if (ensures db exists) } // end if (ensures db exists)
@@ -47,7 +47,7 @@ if (!isset($message)) {
?> ?>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">
<!-- <!--
window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url($db); ?>'); window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url($db, '', '&'); ?>');
//--> //-->
</script> </script>
<?php <?php

View File

@@ -417,10 +417,10 @@ if (uname.value == '') {
} }
} // end if } // end if
if (!empty($GLOBALS['SERVER_SOFTWARE']) && $GLOBALS['SERVER_SOFTWARE'] == 'Microsoft-IIS/5.0') { if (!empty($GLOBALS['SERVER_SOFTWARE']) && $GLOBALS['SERVER_SOFTWARE'] == 'Microsoft-IIS/5.0') {
header('Refresh: 0; url=' . $cfg['PmaAbsoluteUri'] . 'index.php3?' . PMA_generate_common_url()); header('Refresh: 0; url=' . $cfg['PmaAbsoluteUri'] . 'index.php3?' . PMA_generate_common_url('', '', '&'));
} }
else { else {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'index.php3?' . PMA_generate_common_url()); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'index.php3?' . PMA_generate_common_url('', '', '&'));
} }
exit(); exit();
} // end if } // end if

View File

@@ -1074,7 +1074,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// Reloads the navigation frame via JavaScript if required // Reloads the navigation frame via JavaScript if required
if (isset($GLOBALS['reload']) && $GLOBALS['reload']) { if (isset($GLOBALS['reload']) && $GLOBALS['reload']) {
echo "\n"; echo "\n";
$reload_url = './left.php3?' . PMA_generate_common_url($GLOBALS['db']); $reload_url = './left.php3?' . PMA_generate_common_url($GLOBALS['db'], '', '&');
?> ?>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">
<!-- <!--

View File

@@ -13,7 +13,7 @@ if (!isset($is_db) || !$is_db) {
$is_db = @PMA_mysql_select_db($db); $is_db = @PMA_mysql_select_db($db);
} }
if (empty($db) || !$is_db) { if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url() . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit();
} }
} // end if (ensures db exists) } // end if (ensures db exists)
@@ -24,7 +24,7 @@ if (!isset($is_table) || !$is_table) {
} }
if (empty($table) if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) { || !($is_table && @mysql_numrows($is_table))) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?' . PMA_generate_common_url($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit();
} else if (isset($is_table)) { } else if (isset($is_table)) {
mysql_free_result($is_table); mysql_free_result($is_table);

View File

@@ -63,19 +63,19 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
* *
* @author nijel * @author nijel
*/ */
function PMA_generate_common_url ($db = '', $table = '') function PMA_generate_common_url ($db = '', $table = '', $amp = '&amp;')
{ {
global $lang, $convcharset, $server; global $lang, $convcharset, $server;
global $cfg, $allow_recoding; global $cfg, $allow_recoding;
$result = 'lang=' . $lang $result = 'lang=' . $lang
. '&amp;server=' . $server; . $amp . 'server=' . $server;
if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding) if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)
$result .= '&amp;convcharset=' . $convcharset; $result .= $amp . 'convcharset=' . $convcharset;
if (!empty($db)) if (!empty($db))
$result .= '&amp;db='.urlencode($db); $result .= $amp . 'db='.urlencode($db);
if (!empty($table)) if (!empty($table))
$result .= '&amp;table='.urlencode($table); $result .= $amp . 'table='.urlencode($table);
return $result; return $result;
} }
} }

View File

@@ -43,7 +43,7 @@ else if (isset($reload) && $reload) {
?> ?>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">
<!-- <!--
window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url(); ?>'); window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url('', '', '&'); ?>');
//--> //-->
</script> </script>
<?php <?php

View File

@@ -40,7 +40,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
$is_db = @PMA_mysql_select_db($db); $is_db = @PMA_mysql_select_db($db);
} }
if (empty($db) || !$is_db) { if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url() . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit();
} }
// Not a valid table name -> back to the default db_details sub-page // Not a valid table name -> back to the default db_details sub-page
@@ -49,7 +49,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
} }
if (empty($table) if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) { || !($is_table && @mysql_numrows($is_table))) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit(); exit();
} else if (isset($is_table)) { } else if (isset($is_table)) {
mysql_free_result($is_table); mysql_free_result($is_table);

View File

@@ -23,7 +23,7 @@ if (!isset($dontlimitchars)) {
$is_gotofile = FALSE; $is_gotofile = FALSE;
if (isset($after_insert) && $after_insert == 'new_insert') { if (isset($after_insert) && $after_insert == 'new_insert') {
$goto = 'tbl_change.php3?' $goto = 'tbl_change.php3?'
. PMA_generate_common_url($db, $table) . PMA_generate_common_url($db, $table, '&')
. '&goto=' . urlencode($goto) . '&goto=' . urlencode($goto)
. '&pos=' . $pos . '&pos=' . $pos
. '&session_max_rows=' . $session_max_rows . '&session_max_rows=' . $session_max_rows
@@ -33,7 +33,7 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
. (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query)); . (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query));
} else if ($goto == 'sql.php3') { } else if ($goto == 'sql.php3') {
$goto = 'sql.php3?' $goto = 'sql.php3?'
. PMA_generate_common_url($db, $table) . PMA_generate_common_url($db, $table, '&')
. '&pos=' . $pos . '&pos=' . $pos
. '&session_max_rows=' . $session_max_rows . '&session_max_rows=' . $session_max_rows
. '&disp_direction=' . $disp_direction . '&disp_direction=' . $disp_direction