# setting up a few globals.
#
+global $wgProfiling, $wgProfileSampleRate, $wgIP, $wgUseSquid;
+
if( !isset( $wgProfiling ) )
$wgProfiling = false;
function wfProfileClose() {}
}
-
-
/* collect the originating ips */
if( $wgUseSquid && isset( $_SERVER["HTTP_X_FORWARDED_FOR"] ) ) {
# If the web server is behind a reverse proxy, we need to find
# out where our requests are really coming from.
- $hopips = split(', ', $_SERVER['HTTP_X_FORWARDED_FOR'] );
+ $hopips = array_map( "trim", explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ) );
while(in_array(trim(end($hopips)), $wgSquidServers)){
array_pop($hopips);
global $wgBlockCache, $wgParserCache, $wgParser;
# Useful debug output
-if ( function_exists( "getallheaders" ) ) {
+if ( $wgCommandLineMode ) {
+ # wfDebug( '"' . implode( '" "', $argv ) . '"' );
+} elseif ( function_exists( "getallheaders" ) ) {
wfDebug( "\nStart request\n" );
wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
$headers = getallheaders();
$wgDateFormatter = new DateFormatter;
}
-if( !$wgCommandLineMode && isset( $_COOKIE[ini_get("session.name")] ) ) {
+if( !$wgCommandLineMode && ( isset( $_COOKIE[ini_get("session.name")] ) || isset( $_COOKIE["{$wgDBname}Password"] ) ) ) {
User::SetupSession();
}