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)
if (! isset($page_title)) {
if ($GLOBALS['server'] > 0) {
$title = PMA_expandUserString(
! empty($GLOBALS['table']) ? $GLOBALS['cfg']['TitleTable'] :
(! empty($GLOBALS['db']) ? $GLOBALS['cfg']['TitleDatabase'] :
(! empty($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['TitleServer'] :
$GLOBALS['cfg']['TitleDefault']))
);
}
} else {
$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)
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
&& 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