diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index b8b83a439e..b0d41f94e4 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -205,7 +205,10 @@ function adm_page_footer($copyright_html = true)
 
 	garbage_collection();
 
-	exit;
+	if (!defined('PHPBB_EMBEDDED'))
+	{
+		exit;
+	}
 }
 
 /**