diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index a2d730e6a6..ac8775b0a0 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -161,6 +161,7 @@
[Change] "Post details" links with image in MCP. (Bug #39845 - Patch by leviatan21)
[Change] Pm history only shows pms of the receipts you currently reply to (Bug #39505 - Patch by nickvergessen)
[Change] Add quote-button for own pm's in pm-history (Bug #37285 - Patch by nickvergessen)
+ [Change] Fetch requested cookie variables directly from cookie super global. (Bug #47785)
[Feature] Add confirmation for deactivating styles (Bug #14304 - Patch by leviatan21)
[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)
[Feature] Add confirmation for deactivating language packs (Patch by leviatan21)
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 25bef4557a..29f4186a5d 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -71,12 +71,13 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false)
$_REQUEST[$var_name] = isset($_POST[$var_name]) ? $_POST[$var_name] : $_GET[$var_name];
}
- if (!isset($_REQUEST[$var_name]) || (is_array($_REQUEST[$var_name]) && !is_array($default)) || (is_array($default) && !is_array($_REQUEST[$var_name])))
+ $super_global = ($cookie) ? '_COOKIE' : '_REQUEST';
+ if (!isset($$super_global[$var_name]) || is_array($$super_global[$var_name]) != is_array($default))
{
return (is_array($default)) ? array() : $default;
}
- $var = $_REQUEST[$var_name];
+ $var = $$super_global[$var_name];
if (!is_array($default))
{
$type = gettype($default);