Skip to content

Commit b3478d8

Browse files
authored
Merge pull request phpbb#6811 from rxu/ticket/17506
[ticket/17506] Ensure superglobal variables are arrays before applying addition - 3.3.x
2 parents 04f2141 + 10947f3 commit b3478d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

phpBB/phpbb/request/request.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ public function __construct(\phpbb\request\type_cast_helper_interface $type_cast
7070

7171
foreach ($this->super_globals as $const => $super_global)
7272
{
73-
$this->input[$const] = isset($GLOBALS[$super_global]) ? $GLOBALS[$super_global] : array();
73+
$this->input[$const] = isset($GLOBALS[$super_global]) ? (array) $GLOBALS[$super_global] : array();
7474
}
7575

7676
// simulate request_order = GP
77-
$this->original_request = $this->input[\phpbb\request\request_interface::REQUEST];
78-
$this->input[\phpbb\request\request_interface::REQUEST] = $this->input[\phpbb\request\request_interface::POST] + $this->input[\phpbb\request\request_interface::GET];
77+
$this->original_request = (array) $this->input[\phpbb\request\request_interface::REQUEST];
78+
$this->input[\phpbb\request\request_interface::REQUEST] = (array) $this->input[\phpbb\request\request_interface::POST] + (array) $this->input[\phpbb\request\request_interface::GET];
7979

8080
if ($disable_super_globals)
8181
{

0 commit comments

Comments
 (0)