[ticket/13703] Use correct avatar path for PHPBB_USE_BOARD_URL_PATH

This change makes the uploaded avatars use the PHPBB_USE_BOARD_URL_PATH
constant, which is needed when trying to use the get_user_avatar()
function in a listener for index changes.

PHPBB3-13703
This commit is contained in:
Kevin Roy 2015-03-15 10:01:04 -03:00 committed by Marc Alexander
parent 71177c38dc
commit a875802c06

View file

@ -48,8 +48,10 @@ class upload extends \phpbb\avatar\driver\driver
*/ */
public function get_data($row, $ignore_config = false) public function get_data($row, $ignore_config = false)
{ {
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
return array( return array(
'src' => $this->path_helper->get_web_root_path() . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'], 'src' => $root_path . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'],
'width' => $row['avatar_width'], 'width' => $row['avatar_width'],
'height' => $row['avatar_height'], 'height' => $row['avatar_height'],
); );