Skip to content

Commit

Permalink
fix self url - issue #24
Browse files Browse the repository at this point in the history
  • Loading branch information
axelhahn committed Oct 20, 2021
1 parent 5295679 commit 4d6c2e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@

// FIX for https://github.com/axelhahn/pimped-apache-status/issues/24
// $sSelfURL=$aCfg['selfurl'] ? $aCfg['selfurl'] : str_replace('\\','/',str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', __DIR__));
$sSelfURL=preg_replace('#\/admin$#', '', dirname($_SERVER['SCRIPT_NAME']));
// $sSelfURL=preg_replace('#\/admin$#', '', dirname($_SERVER['SCRIPT_NAME']));

$sScriptDir=preg_replace('#^\\'.DIRECTORY_SEPARATOR.'#', '/', dirname($_SERVER['SCRIPT_NAME']));
$sSelfURL=preg_match('#\/admin$#', $sScriptDir)
? preg_replace('#\/admin$#', '', $sScriptDir)
: preg_replace('#^\/$#', '.', $sScriptDir) ;

// ------------------------------------------------------------
// check required features
Expand Down

0 comments on commit 4d6c2e4

Please sign in to comment.