From b81a5afc2541e035b78bfe5f7c8374c9d4ae6b9f Mon Sep 17 00:00:00 2001 From: Hari Sankar R Date: Tue, 3 Apr 2012 22:56:06 +0530 Subject: [ticket/10561] Changes made to function phpbb_style_is_active(). Fixed return type, documented function and, removed style_id from fetch. PHPBB3-10561 --- phpBB/includes/functions.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/functions.php') 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 +* @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']; } /** -- cgit v1.2.1