diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 05725557d3..3c03801b23 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -95,6 +95,7 @@
[Fix] Bring the PostgreSQL backup system back to working order (Bug #22385)
[Change] Sort the tables at the database table backup screen
[Fix] Update correct theme for cached styles in style.php (Bug #25805)
+ [Fix] Also add PHPBB_INSTALLED check to download/file.php for inline avatar delivery
1.ii. Changes since 3.0.0
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 9940bf9aa5..1d325a500e 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -18,6 +18,12 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
if (isset($_GET['avatar']))
{
require($phpbb_root_path . 'config.' . $phpEx);
+
+ if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
+ {
+ exit;
+ }
+
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/cache.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);