Remove '/action' when calculating server URL

This commit is contained in:
Olivier PEREZ 2016-11-14 23:41:57 +01:00
parent 79ae5bb77d
commit cf21a10314

View File

@ -28,6 +28,7 @@ class Utils {
$dirname = dirname($_SERVER['SCRIPT_NAME']);
$dirname = $dirname === '\\' ? '/' : $dirname . '/';
$dirname = str_replace('/admin', '', $dirname);
$dirname = str_replace('/action', '', $dirname);
$server_name = (defined('APP_URL') ? APP_URL : $_SERVER['SERVER_NAME']) . $port . $dirname;
return $scheme . '://' . preg_replace('#//+#', '/', $server_name);