Skip to content

Commit

Permalink
Using just script_name is OK, but it's feasible that SCRIPT_NAME isn'…
Browse files Browse the repository at this point in the history
…t set - this is more common in (badly configured?) nginx servers
  • Loading branch information
mantis committed Sep 4, 2011
1 parent e2f30f7 commit 03f1c7b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config_defaults_inc.php
Expand Up @@ -126,6 +126,12 @@
$t_host = 'localhost';
}

if ( !isset( $_SERVER['SCRIPT_NAME'] )) {

This comment has been minimized.

Copy link
@davidhicks

davidhicks Sep 4, 2011

Member

This always evaluates to false because the parent if condition will ensure that $_SERVER['SCRIPT_NAME'] is set.

echo 'Invalid server configuration detected. Please set $g_path manually in config_inc.php.';
if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && ( stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false ) )
echo ' Please try to add "fastcgi_param SCRIPT_NAME $fastcgi_script_name;" to the nginx server configuration.';
die;
}
$t_self = $_SERVER['SCRIPT_NAME'];
$t_self = filter_var($t_self, FILTER_SANITIZE_STRING);
$t_path = str_replace( basename( $t_self ), '', $t_self );
Expand Down

0 comments on commit 03f1c7b

Please sign in to comment.