diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-07-07 20:06:26 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-07-07 20:06:26 +0200 |
commit | 79af1da0a5f7ec4f7cca43913e5e42dddabd3251 (patch) | |
tree | 1f970cc9f4b77d1c2eba427c034f29a6e87eee0e /phpBB/includes/session.php | |
parent | 3fb9b62c6921751ebc40b74612d5412648134a9e (diff) | |
parent | 71df03960ca55a19aca2ea24517030b6dc2dcaf6 (diff) | |
download | forums-79af1da0a5f7ec4f7cca43913e5e42dddabd3251.tar forums-79af1da0a5f7ec4f7cca43913e5e42dddabd3251.tar.gz forums-79af1da0a5f7ec4f7cca43913e5e42dddabd3251.tar.bz2 forums-79af1da0a5f7ec4f7cca43913e5e42dddabd3251.tar.xz forums-79af1da0a5f7ec4f7cca43913e5e42dddabd3251.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/10250] The site_logo hash is different depending on imageset & language
[ticket/10250] Destroy cached md5 hash of site_logo on refreshing an imageset
[ticket/10250] Overwrite the site_logo width&height when the phpbb logo is used
[ticket/10250] Added the new phpBB Logo with the Registered Trademark Symbol
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r-- | phpBB/includes/session.php | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 9e1aefa309..e36f44ddfa 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -2303,9 +2303,44 @@ class user extends session // Use URL if told so $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path; - $img_data['src'] = $root_path . 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename']; + $path = 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename']; + + $img_data['src'] = $root_path . $path; $img_data['width'] = $this->img_array[$img]['image_width']; $img_data['height'] = $this->img_array[$img]['image_height']; + + // We overwrite the width and height to the phpbb logo's width + // and height here if the contents of the site_logo file are + // really equal to the phpbb_logo + // This allows us to change the dimensions of the phpbb_logo without + // modifying the imageset.cfg and causing a conflict for everyone + // who modified it for their custom logo on updating + if ($img == 'site_logo' && file_exists($phpbb_root_path . $path)) + { + global $cache; + + $img_file_hashes = $cache->get('imageset_site_logo_md5'); + + if ($img_file_hashes === false) + { + $img_file_hashes = array(); + } + + $key = $this->theme['imageset_path'] . '::' . $this->img_array[$img]['image_lang']; + if (!isset($img_file_hashes[$key])) + { + $img_file_hashes[$key] = md5(file_get_contents($phpbb_root_path . $path)); + $cache->put('imageset_site_logo_md5', $img_file_hashes); + } + + $phpbb_logo_hash = '0c461a32cd3621643105f0d02a772c10'; + + if ($phpbb_logo_hash == $img_file_hashes[$key]) + { + $img_data['width'] = '149'; + $img_data['height'] = '52'; + } + } } $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt; |