mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-06 22:45:02 +02:00
[feature/request-class] Removal of direct access to some superglobals
PHPBB3-9716
This commit is contained in:
parent
456de63912
commit
204ee4714b
@ -2698,22 +2698,14 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
|
|||||||
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
|
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
|
||||||
{
|
{
|
||||||
global $user, $template, $db;
|
global $user, $template, $db;
|
||||||
global $phpEx, $phpbb_root_path;
|
global $phpEx, $phpbb_root_path, $request;
|
||||||
|
|
||||||
if (isset($_POST['cancel']))
|
if (isset($_POST['cancel']))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$confirm = false;
|
$confirm = ($user->lang['YES'] === $request->variable('confirm', '', true, phpbb_request_interface::POST));
|
||||||
if (isset($_POST['confirm']))
|
|
||||||
{
|
|
||||||
// language frontier
|
|
||||||
if ($_POST['confirm'] === $user->lang['YES'])
|
|
||||||
{
|
|
||||||
$confirm = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($check && $confirm)
|
if ($check && $confirm)
|
||||||
{
|
{
|
||||||
|
@ -136,13 +136,17 @@ switch ($mode)
|
|||||||
|
|
||||||
case 'delete_cookies':
|
case 'delete_cookies':
|
||||||
|
|
||||||
|
global $request;
|
||||||
|
|
||||||
// Delete Cookies with dynamic names (do NOT delete poll cookies)
|
// Delete Cookies with dynamic names (do NOT delete poll cookies)
|
||||||
if (confirm_box(true))
|
if (confirm_box(true))
|
||||||
{
|
{
|
||||||
$set_time = time() - 31536000;
|
$set_time = time() - 31536000;
|
||||||
|
|
||||||
foreach ($_COOKIE as $cookie_name => $cookie_data)
|
foreach ($request->variable_names(phpbb_request_interface::COOKIE) as $cookie_name)
|
||||||
{
|
{
|
||||||
|
$cookie_data = $request->variable($cookie_name, '', true, phpbb_request_interface::COOKIE);
|
||||||
|
|
||||||
// Only delete board cookies, no other ones...
|
// Only delete board cookies, no other ones...
|
||||||
if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)
|
if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user