diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
index 82d1a7fce2..416034b674 100644
--- a/phpBB/phpbb/avatar/driver/upload.php
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -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)),
diff --git a/phpBB/phpbb/avatar/helper.php b/phpBB/phpbb/avatar/helper.php
index a0f9b6e99a..51592b584f 100644
--- a/phpBB/phpbb/avatar/helper.php
+++ b/phpBB/phpbb/avatar/helper.php
@@ -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";
diff --git a/phpBB/phpbb/template/twig/extension/icon.php b/phpBB/phpbb/template/twig/extension/icon.php
index 966162edae..e44fc8b3ed 100644
--- a/phpBB/phpbb/template/twig/extension/icon.php
+++ b/phpBB/phpbb/template/twig/extension/icon.php
@@ -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;
 					}