Skip to content
Snippets Groups Projects
Commit f40a1cad authored by Robin Appelman's avatar Robin Appelman
Browse files

not all http server add index.php to $_SERVER[SCRIPT_NAME], do it manually

this fixes incorect generated links in some cases
parent 4ac25942
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,11 @@ $SERVERROOT=substr(__FILE__,0,-13); ...@@ -35,7 +35,11 @@ $SERVERROOT=substr(__FILE__,0,-13);
$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); $DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
$SERVERROOT=str_replace("\\",'/',$SERVERROOT); $SERVERROOT=str_replace("\\",'/',$SERVERROOT);
$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT)); $SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
$WEBROOT=substr($_SERVER["SCRIPT_NAME"],0,strlen($_SERVER["SCRIPT_NAME"])-strlen($SUBURI)); $scriptName=$_SERVER["SCRIPT_NAME"];
if(substr($scriptName,-1)=='/'){//if the script isn't a file assume index.php
$scriptName.='index.php';
}
$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen($SUBURI));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment