mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 03:04:09 +02:00
Merge branch 'ticket/13073' into ticket/13073-develop
Conflicts: tests/controller/common_helper_route.php
This commit is contained in:
@@ -3317,6 +3317,11 @@ function get_preg_expression($mode)
|
||||
case 'table_prefix':
|
||||
return '#^[a-zA-Z][a-zA-Z0-9_]*$#';
|
||||
break;
|
||||
|
||||
// Matches the predecing dot
|
||||
case 'path_remove_dot_trailing_slash':
|
||||
return '#^(?:(\.)?)+(?:(.+)?)+(?:([\\/\\\])$)#';
|
||||
break;
|
||||
}
|
||||
|
||||
return '';
|
||||
|
@@ -140,8 +140,15 @@ class helper
|
||||
// If enable_mod_rewrite is false we need to replace the current front-end by app.php, otherwise we need to remove it.
|
||||
$base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url);
|
||||
|
||||
// We need to update the base url to move to the directory of the app.php file.
|
||||
$base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
|
||||
// We need to update the base url to move to the directory of the app.php file
|
||||
if (empty($this->config['enable_mod_rewrite']))
|
||||
{
|
||||
$base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
|
||||
}
|
||||
else
|
||||
{
|
||||
$base_url .= preg_replace(get_preg_expression('path_remove_dot_trailing_slash'), '$2', $this->phpbb_root_path);
|
||||
}
|
||||
|
||||
$base_url = $this->filesystem->clean_path($base_url);
|
||||
|
||||
|
Reference in New Issue
Block a user