Skip to content

Commit 03f1c7b

Browse files
committedSep 4, 2011
Using just script_name is OK, but it's feasible that SCRIPT_NAME isn't set - this is more common in (badly configured?) nginx servers
1 parent e2f30f7 commit 03f1c7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎config_defaults_inc.php

+6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
$t_host = 'localhost';
127127
}
128128

129+
if ( !isset( $_SERVER['SCRIPT_NAME'] )) {
Has a conversation. Original line has a conversation.
130+
echo 'Invalid server configuration detected. Please set $g_path manually in config_inc.php.';
131+
if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && ( stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false ) )
132+
echo ' Please try to add "fastcgi_param SCRIPT_NAME $fastcgi_script_name;" to the nginx server configuration.';
133+
die;
134+
}
129135
$t_self = $_SERVER['SCRIPT_NAME'];
130136
$t_self = filter_var($t_self, FILTER_SANITIZE_STRING);
131137
$t_path = str_replace( basename( $t_self ), '', $t_self );

0 commit comments

Comments
 (0)
Please sign in to comment.