diff --git a/ChangeLog b/ChangeLog index 3198c274c..002dabbaf 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ $Source$ config.inc.php3: Rewrote the whole backwards compatibility code for old config files. * config.inc.php3: Beautified code. + * header.inc.php3, footer.inc.php3, libraries/common.lib.php3: + Header and footer my now be included inside a function as well + (Better fix against bug #549570). 2002-06-19 Marc Delisle * index.php3: missing header, thanks to Michal Cihar diff --git a/footer.inc.php3 b/footer.inc.php3 index bfb02f16c..139cb4bc3 100755 --- a/footer.inc.php3 +++ b/footer.inc.php3 @@ -8,11 +8,11 @@ /** * Close MySql non-persistent connections */ -if (isset($dbh) && $dbh) { - @mysql_close($dbh); +if (isset($GLOBALS['dbh']) && $GLOBALS['dbh']) { + @mysql_close($GLOBALS['dbh']); } -if (isset($userlink) && $userlink) { - @mysql_close($userlink); +if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) { + @mysql_close($GLOBALS['userlink']); } ?> @@ -24,8 +24,8 @@ if (isset($userlink) && $userlink) { /** * Sends bufferized data */ -if (isset($cfg['OBGzip']) && $cfg['OBGzip'] - && isset($ob_mode) && $ob_mode) { - PMA_outBufferPost($ob_mode); +if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip'] + && isset($GLOBALS['ob_mode']) && $GLOBALS['ob_mode']) { + PMA_outBufferPost($GLOBALS['ob_mode']); } ?> diff --git a/header.inc.php3 b/header.inc.php3 index 98da4745f..e31656383 100755 --- a/header.inc.php3 +++ b/header.inc.php3 @@ -7,10 +7,10 @@ */ require('./libraries/common.lib.php3'); require('./libraries/ob.lib.php3'); -if ($cfg['OBGzip']) { - $ob_mode = PMA_outBufferModeGet(); - if ($ob_mode) { - PMA_outBufferPre($ob_mode); +if ($GLOBALS['cfg']['OBGzip']) { + $GLOBALS['ob_mode'] = PMA_outBufferModeGet(); + if ($GLOBALS['ob_mode']) { + PMA_outBufferPre($GLOBALS['ob_mode']); } } @@ -19,13 +19,13 @@ if ($cfg['OBGzip']) { * Sends http headers */ // Don't use cache (required for Opera) -$now = gmdate('D, d M Y H:i:s') . ' GMT'; +$GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT'; header('Expires: 0'); // rfc2616 - Section 14.21 -header('Last-Modified: ' . $now); +header('Last-Modified: ' . $GLOBALS['now']); header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1 header('Pragma: no-cache'); // HTTP/1.0 // Define the charset to be used -header('Content-Type: text/html; charset=' . $charset); +header('Content-Type: text/html; charset=' . $GLOBALS['charset']); /** @@ -34,23 +34,23 @@ header('Content-Type: text/html; charset=' . $charset); // Gets the font sizes to use PMA_setFontSizes(); // Defines the cell alignment values depending on text direction -if ($text_dir == 'ltr') { - $cell_align_left = 'left'; - $cell_align_right = 'right'; +if ($GLOBALS['text_dir'] == 'ltr') { + $GLOBALS['cell_align_left'] = 'left'; + $GLOBALS['cell_align_right'] = 'right'; } else { - $cell_align_left = 'right'; - $cell_align_right = 'left'; + $GLOBALS['cell_align_left'] = 'right'; + $GLOBALS['cell_align_right'] = 'left'; } ?> - + phpMyAdmin ' . "\n"; +if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) { + echo '' . "\n"; } ?>