aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHari Sankar R <hsr@theinglorio.us>2012-04-03 22:56:06 +0530
committerHari Sankar R <hsr@theinglorio.us>2012-04-03 22:56:06 +0530
commitb81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f (patch)
tree041a9f5aac00895c6d9db33544a19b2ec09fef1a
parent084e1ae5603f4204945d25afcfabaeb1198df20f (diff)
downloadforums-b81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f.tar
forums-b81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f.tar.gz
forums-b81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f.tar.bz2
forums-b81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f.tar.xz
forums-b81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f.zip
[ticket/10561] Changes made to function phpbb_style_is_active().
Fixed return type, documented function and, removed style_id from fetch. PHPBB3-10561
-rw-r--r--phpBB/includes/functions.php12
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php2
2 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 530638c56b..3881299648 100644
--- a/phpBB/includes/functions.php
+++ b/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'];
}
/**
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 0df8acd5af..e81bd1e1bb 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -62,7 +62,7 @@ class ucp_prefs
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),