Undefined variables when no server has been selected and no default server is defined

This commit is contained in:
Marc Delisle
2011-09-24 06:17:34 -04:00
parent 5b2befc171
commit 158ce0657a

View File

@@ -20,12 +20,14 @@ if ( false === $GLOBALS['cfg']['AllowThirdPartyFraming']) {
} }
// generate title (unless we already have $page_title, from cookie auth) // generate title (unless we already have $page_title, from cookie auth)
if (! isset($page_title)) { if (! isset($page_title)) {
$title = PMA_expandUserString( if ($GLOBALS['server'] > 0) {
!empty($GLOBALS['table']) ? $GLOBALS['cfg']['TitleTable'] : $title = PMA_expandUserString(
(!empty($GLOBALS['db']) ? $GLOBALS['cfg']['TitleDatabase'] : ! empty($GLOBALS['table']) ? $GLOBALS['cfg']['TitleTable'] :
(!empty($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['TitleServer'] : (! empty($GLOBALS['db']) ? $GLOBALS['cfg']['TitleDatabase'] :
(! empty($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['TitleServer'] :
$GLOBALS['cfg']['TitleDefault'])) $GLOBALS['cfg']['TitleDefault']))
); );
}
} else { } else {
$title = $page_title; $title = $page_title;
} }
@@ -57,7 +59,7 @@ foreach ($GLOBALS['js_include'] as $js_script_file) {
// Updates the title of the frameset if possible (ns4 does not allow this) // Updates the title of the frameset if possible (ns4 does not allow this)
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown' if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
&& typeof(parent.document.title) == 'string') { && typeof(parent.document.title) == 'string') {
parent.document.title = '<?php echo PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))); ?>'; parent.document.title = '<?php echo (isset($title) ? PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))) : ''); ?>';
} }
<?php <?php