diff options
Diffstat (limited to 'phpBB/download/file.php')
-rw-r--r-- | phpBB/download/file.php | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 5016e7f549..2a9c472ca7 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -31,12 +31,7 @@ else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT' if (isset($_GET['avatar'])) { - if (!defined('E_DEPRECATED')) - { - define('E_DEPRECATED', 8192); - } - error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED); - + require($phpbb_root_path . 'includes/startup.' . $phpEx); require($phpbb_root_path . 'config.' . $phpEx); if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type)) @@ -49,15 +44,20 @@ if (isset($_GET['avatar'])) require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx); + require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - $class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx); - $class_loader->register(); + $phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); + $phpbb_class_loader_ext->register(); + $phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); + $phpbb_class_loader->register(); // set up caching $cache_factory = new phpbb_cache_factory($acm_type); $cache = $cache_factory->get_service(); - $class_loader->set_cache($cache->get_driver()); + $phpbb_class_loader_ext->set_cache($cache->get_driver()); + $phpbb_class_loader->set_cache($cache->get_driver()); + $request = new phpbb_request(); $db = new $sql_db(); // Connect to DB @@ -67,13 +67,18 @@ if (isset($_GET['avatar'])) } unset($dbpasswd); + request_var('', 0, false, false, $request); + // worst-case default - $browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0'; + $browser = strtolower($request->header('User-Agent', 'msie 6.0')); $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); set_config(null, null, null, $config); set_config_count(null, null, null, $config); + // load extensions + $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver()); + $filename = request_var('avatar', ''); $avatar_group = false; $exit = false; @@ -194,8 +199,7 @@ else $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - // Global announcement? - $f_download = (!$row) ? $auth->acl_getf_global('f_download') : $auth->acl_get('f_download', $row['forum_id']); + $f_download = $auth->acl_get('f_download', $row['forum_id']); if ($auth->acl_get('u_download') && $f_download) { |