Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[ticket/10561] Changes made to function phpbb_style_is_active().

Fixed return type, documented function and, removed
style_id from fetch.

PHPBB3-10561
  • Loading branch information...
commit b81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f 1 parent 084e1ae
Hari Sankar R authored
View
12 phpBB/includes/functions.php
@@ -1239,21 +1239,23 @@ function style_select($default = '', $all = false)
}
/**
-* Check if style is activated
+* @author Hari Sankar R <hsr@theinglorio.us>
+* @param int $style_id The style_id of a style which should be checked if activated or not.
+* @return boolean
*/
-function style_verify($style_id = 0)
+function phpbb_style_is_active($style_id)
{
global $db;
- $sql = 'SELECT style_id, style_active
+ $sql = 'SELECT style_active
FROM ' . STYLES_TABLE . "
- WHERE style_id = $style_id";
+ WHERE style_id = ". (int) $style_id;
$result = $db->sql_query($sql);
$style_verified = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- return $style_verified['style_active'];
+ return (bool) $style_verified['style_active'];
}
/**
View
2  phpBB/includes/ucp/ucp_prefs.php
@@ -62,7 +62,7 @@ function main($id, $mode)
if ($submit)
{
$data['style'] = ($config['override_user_style']) ? $config['default_style'] :
- (style_verify($data['style']) ? $data['style'] : ((int) $user->data['user_style']));
+ (phpbb_style_is_active($data['style']) ? $data['style'] : ((int) $user->data['user_style']));
$error = validate_data($data, array(
'dateformat' => array('string', false, 1, 30),
Please sign in to comment.
Something went wrong with that request. Please try again.