mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
[ticket/10561] All users can choose deactivated styles (fixed).
A form exploit enabled the users to select a deactivated style. Fixed with extra check on submit, with a new function styles_verify to check if the selected style is activated or not. PHPBB3-10561
This commit is contained in:
@@ -1238,6 +1238,24 @@ function style_select($default = '', $all = false)
|
||||
return $style_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if style is activated
|
||||
*/
|
||||
function style_verify($style_id = 0)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = 'SELECT style_id, style_active
|
||||
FROM ' . STYLES_TABLE . "
|
||||
WHERE style_id = $style_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$style_verified = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return $style_verified['style_active'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Pick a timezone
|
||||
*/
|
||||
|
Reference in New Issue
Block a user