replaced $_ENV with getenv()
This commit is contained in:
@@ -10,8 +10,9 @@ $Source$
|
|||||||
libraries/footer.inc.php, libraries/ip_allow_deny.lib.php,
|
libraries/footer.inc.php, libraries/ip_allow_deny.lib.php,
|
||||||
libraries/common.lib.php, libraries/header.inc.php,
|
libraries/common.lib.php, libraries/header.inc.php,
|
||||||
libraries/grab_globals.lib.php, libraries/auth/cookie.auth.lib.php,
|
libraries/grab_globals.lib.php, libraries/auth/cookie.auth.lib.php,
|
||||||
libraries/auth/http.auth.lib.php, libraries/fpdf/fdpf.php:
|
libraries/auth/http.auth.lib.php, libraries/fpdf/fdpf.php, index.php:
|
||||||
replaced $_SERVER with getenv()
|
replaced $_SERVER and $_ENV with getenv()
|
||||||
|
PMA should now work without registered $_ENV and $_SERVER variables
|
||||||
|
|
||||||
2006-03-04 Marc Delisle <lem9@users.sourceforge.net>
|
2006-03-04 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* lang/swedish: Update, thanks to Björn T. Hallberg - bjornth.
|
* lang/swedish: Update, thanks to Björn T. Hallberg - bjornth.
|
||||||
|
36
index.php
36
index.php
@@ -33,12 +33,12 @@
|
|||||||
/**
|
/**
|
||||||
* Gets core libraries and defines some variables
|
* Gets core libraries and defines some variables
|
||||||
*/
|
*/
|
||||||
require_once('./libraries/common.lib.php');
|
require_once './libraries/common.lib.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the ThemeManager if it hasn't been included yet
|
* Includes the ThemeManager if it hasn't been included yet
|
||||||
*/
|
*/
|
||||||
require_once('./libraries/relation.lib.php');
|
require_once './libraries/relation.lib.php';
|
||||||
|
|
||||||
// free the session file, for the other frames to be loaded
|
// free the session file, for the other frames to be loaded
|
||||||
session_write_close();
|
session_write_close();
|
||||||
@@ -46,9 +46,7 @@ session_write_close();
|
|||||||
// Gets the host name
|
// Gets the host name
|
||||||
// loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
|
// loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
|
||||||
if (empty($HTTP_HOST)) {
|
if (empty($HTTP_HOST)) {
|
||||||
if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
|
if (getenv('HTTP_HOST')) {
|
||||||
$HTTP_HOST = $_ENV['HTTP_HOST'];
|
|
||||||
} elseif (@getenv('HTTP_HOST')) {
|
|
||||||
$HTTP_HOST = getenv('HTTP_HOST');
|
$HTTP_HOST = getenv('HTTP_HOST');
|
||||||
} else {
|
} else {
|
||||||
$HTTP_HOST = '';
|
$HTTP_HOST = '';
|
||||||
@@ -58,28 +56,28 @@ if (empty($HTTP_HOST)) {
|
|||||||
|
|
||||||
// purge querywindow history
|
// purge querywindow history
|
||||||
$cfgRelation = PMA_getRelationsParam();
|
$cfgRelation = PMA_getRelationsParam();
|
||||||
if ( $GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork'] ) {
|
if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
|
||||||
PMA_purgeHistory( $GLOBALS['cfg']['Server']['user'] );
|
PMA_purgeHistory( $GLOBALS['cfg']['Server']['user'] );
|
||||||
}
|
}
|
||||||
unset( $cfgRelation );
|
unset($cfgRelation);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pass variables to child pages
|
* pass variables to child pages
|
||||||
*/
|
*/
|
||||||
$drops = array( 'lang', 'server', 'convcharset', 'collation_connection',
|
$drops = array('lang', 'server', 'convcharset', 'collation_connection',
|
||||||
'db', 'table' );
|
'db', 'table');
|
||||||
|
|
||||||
foreach ( $drops as $each_drop ) {
|
foreach ($drops as $each_drop) {
|
||||||
if ( ! array_key_exists( $each_drop, $_GET ) ) {
|
if (! array_key_exists($each_drop, $_GET)) {
|
||||||
unset( $_GET[$each_drop] );
|
unset($_GET[$each_drop]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset( $drops, $each_drop );
|
unset($drops, $each_drop);
|
||||||
|
|
||||||
if ( ! isset($GLOBALS['db']) || ! strlen($GLOBALS['db']) ) {
|
if (! isset($GLOBALS['db']) || ! strlen($GLOBALS['db'])) {
|
||||||
$main_target = $GLOBALS['cfg']['DefaultTabServer'];
|
$main_target = $GLOBALS['cfg']['DefaultTabServer'];
|
||||||
} elseif ( ! isset($GLOBALS['table']) || ! strlen($GLOBALS['table']) ) {
|
} elseif (! isset($GLOBALS['table']) || ! strlen($GLOBALS['table'])) {
|
||||||
$_GET['db'] = $GLOBALS['db'];
|
$_GET['db'] = $GLOBALS['db'];
|
||||||
$main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
|
$main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
|
||||||
} else {
|
} else {
|
||||||
@@ -88,11 +86,11 @@ if ( ! isset($GLOBALS['db']) || ! strlen($GLOBALS['db']) ) {
|
|||||||
$main_target = $GLOBALS['cfg']['DefaultTabTable'];
|
$main_target = $GLOBALS['cfg']['DefaultTabTable'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$url_query = PMA_generate_common_url( $_GET );
|
$url_query = PMA_generate_common_url($_GET);
|
||||||
|
|
||||||
if ( ! empty( $GLOBALS['target'] )
|
if (! empty( $GLOBALS['target'])
|
||||||
&& preg_match( '@[a-z_]+\.php@', $GLOBALS['target'] )
|
&& preg_match( '@[a-z_]+\.php@', $GLOBALS['target'])
|
||||||
&& $GLOBALS['target'] != 'index.php' ) {
|
&& $GLOBALS['target'] != 'index.php') {
|
||||||
$main_target = $GLOBALS['target'];
|
$main_target = $GLOBALS['target'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user