Make it possible to run indieauth-openid as .phar
[indieauth-openid.git] / www / about.php
index 425b23a2cf7359603548329c246ed667420bad8c..c56b9aa35b9644c8e3aebb94e29a2eb9add1c8b1 100644 (file)
@@ -4,7 +4,10 @@ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {
 } else {
     $prot = 'http';
 }
-$epUrl  = $prot . '://' . $_SERVER['HTTP_HOST'] . '/';
+$epUrl = $prot . '://' . $_SERVER['HTTP_HOST'] . '/';
+if (Phar::running()) {
+    $epUrl .= ltrim($_SERVER['SCRIPT_NAME'], '/') . '/';
+}
 $hepUrl = htmlspecialchars($epUrl);
 
 ?>