We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfd51cb commit 2516f3bCopy full SHA for 2516f3b
system/core/Config.php
@@ -76,9 +76,11 @@ public function __construct()
76
// Set the base_url automatically if none was provided
77
if (empty($this->config['base_url']))
78
{
79
+ $script_basename = basename($_SERVER['SCRIPT_NAME']);
80
+
81
$base_url = (is_https() ? 'https' : 'http') . '://'
82
. (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost')
- . str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
83
+ . preg_replace('/'.preg_quote($script_basename).'$/', '', $_SERVER['SCRIPT_NAME']);
84
85
$this->set_item('base_url', $base_url);
86
}
0 commit comments