1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +02:00

Merge branch 'ticket/13276' into ticket/13276-master

This commit is contained in:
Marc Alexander
2023-06-30 16:45:37 +02:00
9 changed files with 17 additions and 24 deletions

View File

@@ -23,7 +23,7 @@ class local extends \phpbb\avatar\driver\driver
*/
public function get_data($row)
{
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
$root_path = $this->path_helper->get_web_root_path();
return array(
'src' => $root_path . $this->config['avatar_gallery_path'] . '/' . $row['avatar'],

View File

@@ -100,8 +100,7 @@ class upload extends \phpbb\avatar\driver\driver
return false;
}
$use_board = defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH;
$web_path = $use_board ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
$web_path = $this->path_helper->get_web_root_path();
$template->assign_vars([
'AVATAR_ALLOWED_EXTENSIONS' => implode(',', preg_replace('/^/', '.', $this->allowed_extensions)),

View File

@@ -231,8 +231,7 @@ class helper
* We need to correct the phpBB root path in case this is called from a controller,
* because the web path will be incorrect otherwise.
*/
$board_url = defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH;
$web_path = $board_url ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
$web_path = $this->path_helper->get_web_root_path();
$style_path = rawurlencode($this->user->style['style_path']);
return "{$web_path}styles/{$style_path}/theme/images/no_avatar.gif";

View File

@@ -153,6 +153,11 @@ class path_helper
return $this->web_root_path;
}
if (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH)
{
return $this->web_root_path = generate_board_url() . '/';
}
// We do not need to escape $path_info, $request_uri and $script_name because we can not find their content in the result.
// Path info (e.g. /foo/bar)
$path_info = filesystem_helper::clean_path($this->symfony_request->getPathInfo());

View File

@@ -95,15 +95,12 @@ class icon extends AbstractExtension
$filesystem = $environment->get_filesystem();
$root_path = $environment->get_web_root_path();
$board_url = defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH;
$base_path = $board_url ? generate_board_url() . '/' : $root_path;
// Iterate over the user's styles and check for icon existance
foreach ($this->get_style_list() as $style_path)
{
if ($filesystem->exists("{$root_path}styles/{$style_path}/theme/png/{$icon}.png"))
{
$source = "{$base_path}styles/{$style_path}/theme/png/{$icon}.png";
$source = "{$root_path}styles/{$style_path}/theme/png/{$icon}.png";
break;
}

View File

@@ -155,7 +155,7 @@ class renderer implements \phpbb\textformatter\renderer_interface
/**
* @see smiley_text()
*/
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $path_helper->get_web_root_path();
$root_path = $path_helper->get_web_root_path();
$this->set_smilies_path($root_path . $config['smilies_path']);
}