diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index e44e7781b2..220a7ad5ed 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -145,6 +145,7 @@
[Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)
[Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
+ [Sec] Check for non-empty config.php within style.php (Report #s24575) - reported by bantu
diff --git a/phpBB/style.php b/phpBB/style.php
index c0f8ed7352..6d5705a074 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -21,6 +21,11 @@ date_default_timezone_set('UTC');
require($phpbb_root_path . 'config.' . $phpEx);
+if (!defined('PHPBB_INSTALLED') || empty($dbms) || !isset($dbhost) || !isset($dbpasswd) || empty($dbuser))
+{
+ exit;
+}
+
if (version_compare(PHP_VERSION, '6.0.0-dev', '<'))
{
set_magic_quotes_runtime(0);