From 0d62da1a45ead900c3e3f6f325b74b2215c6e4cf Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 26 Jun 2008 11:04:44 -0400 Subject: [PATCH] Change $db->query_first to $db->queryFirst --- admin/global.php | 2 +- admin/index.php | 6 +++--- admin/permission.php | 6 +++--- admin/product.php | 6 +++--- admin/user.php | 4 ++-- attachment.php | 6 +++--- editcomment.php | 10 +++++----- editreport.php | 4 ++-- favorite.php | 4 ++-- install/convert_database_charset.php | 2 +- install/upgrade.php | 2 +- install/upgrade5.php | 2 +- login.php | 4 ++-- register.php | 4 ++-- search.php | 20 ++++++++++---------- showhistory.php | 2 +- showreport.php | 12 ++++++------ userctrl.php | 4 ++-- viewattachment.php | 4 ++-- vote.php | 4 ++-- 20 files changed, 54 insertions(+), 54 deletions(-) diff --git a/admin/global.php b/admin/global.php index 5e6abf3..a71a06a 100755 --- a/admin/global.php +++ b/admin/global.php @@ -72,7 +72,7 @@ function admin_login() if (can_perform('canadminpanel')) { - $session = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); + $session = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); if ($session AND $session['userid'] == bugdar::$userinfo['userid'] AND $session['dateline'] >= (TIMENOW - 3600)) { // renew the cookie diff --git a/admin/index.php b/admin/index.php index 9ef0665..816df90 100755 --- a/admin/index.php +++ b/admin/index.php @@ -56,7 +56,7 @@ $admin->row_span(T('Version Information'), 'thead'); $admin->row_text(T('Bugdar Version'), bugdar::$options['trackerversion']); $admin->row_text(T('PHP Version'), phpversion()); -$mysql = $db->query_first("SELECT VERSION() AS version"); +$mysql = $db->queryFirst("SELECT VERSION() AS version"); $admin->row_text(T('MySQL Version'), $mysql['version']); $admin->row_text(T('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE'])); @@ -64,12 +64,12 @@ $admin->row_text(T('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVE // ------------------------------------------------------------------- $admin->row_span(T('Server Options'), 'thead'); -$mysql = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'"); +$mysql = $db->queryFirst("SHOW VARIABLES LIKE 'max_allowed_packet'"); $admin->row_text(T('MySQL: Maximum Packet Size'), $mysql['Value']); $admin->row_text(T('MySQL: Maximum Upload Size'), BSFunctions::fetch_max_php_file_size()); -$mysql = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'"); +$mysql = $db->queryFirst("SHOW VARIABLES LIKE 'ft_min_word_len'"); $admin->row_text(T('MySQL: Full-Text Search Minimum Word Length'), $mysql['Value']); $admin->row_text(T('PHP: Safe Mode'), ((ini_get('safe_mode') == 1 OR strtolower(ini_get('safe_mode')) == 'on') ? T('Yes') : T('No'))); diff --git a/admin/permission.php b/admin/permission.php index 7075a3b..512edb6 100755 --- a/admin/permission.php +++ b/admin/permission.php @@ -98,9 +98,9 @@ if ($_REQUEST['do'] == 'edit') 'usergroupid' => TYPE_UINT, 'productid' => TYPE_UINT )); - $perm = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $bugsys->in['usergroupid'] . " AND productid = " . $bugsys->in['productid']); - $usergroup = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $bugsys->in['usergroupid']); - $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); + $perm = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $bugsys->in['usergroupid'] . " AND productid = " . $bugsys->in['productid']); + $usergroup = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $bugsys->in['usergroupid']); + $product = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); if (!$usergroup OR !$product) { diff --git a/admin/product.php b/admin/product.php index 34c9658..7efc13e 100755 --- a/admin/product.php +++ b/admin/product.php @@ -113,7 +113,7 @@ if ($_REQUEST['do'] == 'addversion') if ($bugsys->in['productid'] != -1) { - $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); + $product = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); if (!is_array($product)) { $admin->error(L_INVALID_ID); @@ -161,7 +161,7 @@ if ($_REQUEST['do'] == 'editversion') { $admin->page_start(T('Edit Version')); - $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "version WHERE versionid = " . $input->inputClean('versionid', TYPE_UINT)); + $version = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "version WHERE versionid = " . $input->inputClean('versionid', TYPE_UINT)); if (!is_array($version)) { $admin->error(L_INVALID_ID); @@ -289,7 +289,7 @@ if ($_REQUEST['do'] == 'editproduct') $admin->page_start(T('Edit Product')); - $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); + $product = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); if (!is_array($product)) { $admin->error(L_INVALID_ID); diff --git a/admin/user.php b/admin/user.php index 0f790a1..26ba541 100644 --- a/admin/user.php +++ b/admin/user.php @@ -331,7 +331,7 @@ if ($_REQUEST['do'] == 'search') if (is_numeric($bugsys->in['userdata'])) { $input->inputClean('userdata', TYPE_UINT); - if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $bugsys->in['userdata'])) + if ($db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $bugsys->in['userdata'])) { header('Location: user.php?do=edit&userid=' . $bugsys->in['userdata']); } @@ -395,7 +395,7 @@ if ($_REQUEST['do'] == 'showall') $admin->table_head(T('Show All Users'), 4); $admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions'))); - $count = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user"); + $count = $db->queryFirst("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user"); $pagination->setTotal($count['count']); $pagination->splitPages(); diff --git a/attachment.php b/attachment.php index 8bda1b6..77126c1 100755 --- a/attachment.php +++ b/attachment.php @@ -38,14 +38,14 @@ APIError(array(new API_Error_Handler($message), 'user_cumulative')); if (isset($bugsys->in['attachmentid'])) { - $attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $input->inputClean('attachmentid', TYPE_UINT)); + $attachment = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $input->inputClean('attachmentid', TYPE_UINT)); if (!$attachment) { $message->error(L_INVALID_ID); } } -$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . (($attachment['attachmentid']) ? $attachment['bugid'] : $input->inputClean('bugid', TYPE_UINT))); +$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . (($attachment['attachmentid']) ? $attachment['bugid'] : $input->inputClean('bugid', TYPE_UINT))); if (!$bug) { $message->error(L_INVALID_ID); @@ -74,7 +74,7 @@ if ($_POST['do'] == 'insert') } // max packet size - $var = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'"); + $var = $db->queryFirst("SHOW VARIABLES LIKE 'max_allowed_packet'"); $bugsys->debug("max_allowed_packet = $var[Value]"); // create alias diff --git a/editcomment.php b/editcomment.php index dd7c0e3..4ebaa25 100644 --- a/editcomment.php +++ b/editcomment.php @@ -40,7 +40,7 @@ $commentapi->fetch(); $comment =& $commentapi->objdata; -$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]"); +$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]"); if (!check_bug_permissions($bug)) { @@ -64,14 +64,14 @@ if ($_POST['do'] == 'kill') } // get the last post (as in prior to deletion) - $lastpost = $db->query_first("SELECT commentid FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] ORDER BY dateline DESC"); + $lastpost = $db->queryFirst("SELECT commentid FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] ORDER BY dateline DESC"); $commentapi->delete(); // check to see if we need to rebuild the lastpost information if ($lastpost['commentid'] == $comment['commentid']) { - $lastgoodpublic = $db->query_first(" + $lastgoodpublic = $db->queryFirst(" SELECT comment.* AS comment, user.displayname AS username FROM " . TABLE_PREFIX . "comment AS comment LEFT JOIN " . TABLE_PREFIX . "user AS user @@ -79,7 +79,7 @@ if ($_POST['do'] == 'kill') WHERE bugid = $bug[bugid] AND !hidden ORDER BY dateline DESC "); - $lastgoodprivate = $db->query_first(" + $lastgoodprivate = $db->queryFirst(" SELECT comment.* AS comment, user.displayname AS username FROM " . TABLE_PREFIX . "comment AS comment LEFT JOIN " . TABLE_PREFIX . "user AS user @@ -150,7 +150,7 @@ if ($_POST['do'] == 'update') $log->add_data(true, $commentapi->objdata, array('comment', 'hidden'), false, 'comment'); $log->add_data(false, $commentapi->values, array('comment', 'hidden'), false, 'comment'); - $lastgood = $db->query_first(" + $lastgood = $db->queryFirst(" SELECT comment.* AS comment, user.displayname AS username FROM " . TABLE_PREFIX . "comment AS comment LEFT JOIN " . TABLE_PREFIX . "user AS user diff --git a/editreport.php b/editreport.php index 637b753..432723b 100644 --- a/editreport.php +++ b/editreport.php @@ -32,7 +32,7 @@ require_once('./includes/api_comment.php'); require_once('./includes/class_api_error.php'); APIError(array(new API_Error_Handler($message), 'user_cumulative')); -$bug = $db->query_first(" +$bug = $db->queryFirst(" SELECT bug.*, user.email, user.displayname, user.showemail FROM " . TABLE_PREFIX . "bug AS bug LEFT JOIN " . TABLE_PREFIX . "user AS user @@ -104,7 +104,7 @@ if ($_POST['do'] == 'update') // handle automations if ($bugsys->in['automation']) { - $automation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "automation WHERE actionid = " . $input->inputClean('automation', TYPE_UINT)); + $automation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "automation WHERE actionid = " . $input->inputClean('automation', TYPE_UINT)); if ($automation) { $automation['fields'] = unserialize($automation['fieldchanges']); diff --git a/favorite.php b/favorite.php index bec6abe..a4943d4 100644 --- a/favorite.php +++ b/favorite.php @@ -42,7 +42,7 @@ require_once('./includes/class_sort.php'); if ($_REQUEST['do'] == 'handle') { $input->inputClean('bugid', TYPE_UINT); - $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->in['bugid']); + $bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->in['bugid']); if (!check_bug_permissions($bug)) { $message->errorPermission(); @@ -53,7 +53,7 @@ if ($_REQUEST['do'] == 'handle') $message->errorPermission(); } - if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid'])) + if ($db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid'])) { $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']); $message->redirect(T('This bug has been removed from your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); diff --git a/install/convert_database_charset.php b/install/convert_database_charset.php index cc8d6ee..99683f4 100644 --- a/install/convert_database_charset.php +++ b/install/convert_database_charset.php @@ -58,7 +58,7 @@ $admin->page_start('Convert Database Character Set'); if ($bugsys->in['step'] == 0) { - $collation = $db->query_first("SHOW VARIABLES LIKE 'collation_database'"); + $collation = $db->queryFirst("SHOW VARIABLES LIKE 'collation_database'"); echo '

Convert Database Character Set

'; echo '

Earlier versions of Bugdar did not check or enforce the MySQL database character set or collation. It is recommended that the database be set at ' . TARGET . '. This script can migrate all of data from your current character set/collation of ' . $collation['Value'] . '. If you would like to convert your database to utf8, please click the link below.

'; diff --git a/install/upgrade.php b/install/upgrade.php index 6dca12e..567af00 100644 --- a/install/upgrade.php +++ b/install/upgrade.php @@ -27,7 +27,7 @@ if (!isset($bugsys->in['next'])) { $db->showerrors = false; - $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = 'trackerversion'"); + $version = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = 'trackerversion'"); $version = $version['value']; if ($version == '[#]version[#]') diff --git a/install/upgrade5.php b/install/upgrade5.php index 4b7be8e..5fa4021 100644 --- a/install/upgrade5.php +++ b/install/upgrade5.php @@ -61,7 +61,7 @@ if ($bugsys->in['mark'] == 1) build_automations(); echo "Rebuilding the automations cahce
\n"; - $topic = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = 'newreply'"); + $topic = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = 'newreply'"); if (md5($topic['body']) == '7e1154340454ca6d8f8ba47aab057c23') { $topic = $db->query("UPDATE " . TABLE_PREFIX . "fieldhelp SET body = 'Here you can specify additional comments. If you do not change any fields, this will merely attach a comment. diff --git a/login.php b/login.php index 4e8a0fa..75f1be8 100755 --- a/login.php +++ b/login.php @@ -148,7 +148,7 @@ if ($_POST['do'] == 'resetpw') $db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE dateline < " . (TIMENOW - 86400)); // now look for ours - $activation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'"); + $activation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'"); if (!$activation) { $message->error(L_INVALID_ID); @@ -192,7 +192,7 @@ if ($_REQUEST['do'] == 'recoverpw') $db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE dateline < " . (TIMENOW - 86400)); // now look for ours - $activation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'"); + $activation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'"); if (!$activation) { $message->error(T('Invalid activation reset key. Please make sure you copied the URL exactly as it appeared in the email.')); diff --git a/register.php b/register.php index a27a0e8..05c3a58 100755 --- a/register.php +++ b/register.php @@ -163,9 +163,9 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'activate') { $input->inputClean('userid', TYPE_UINT); - if ($useractivation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $bugsys->in['userid'] . " AND activator = '" . $bugsys->input_escape('activator') . "'")) + if ($useractivation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $bugsys->in['userid'] . " AND activator = '" . $bugsys->input_escape('activator') . "'")) { - $user = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $bugsys->in['userid']); + $user = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $bugsys->in['userid']); $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = $useractivation[usergroupid] WHERE userid = " . $bugsys->in['userid']); $db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $bugsys->in['userid']); diff --git a/search.php b/search.php index 6107256..a7f5c41 100644 --- a/search.php +++ b/search.php @@ -52,7 +52,7 @@ define('MODE_ANY', 1); define('MODE_ALL', 2); define('MODE_RAW', 3); -$var = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'"); +$var = $db->queryFirst("SHOW VARIABLES LIKE 'ft_min_word_len'"); define('SEARCH_WORD_MIN', $var['Value']); $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = 0 AND dateline < " . (TIMENOW - 3600)); @@ -76,11 +76,11 @@ if ($_REQUEST['do'] == 'search') } else if ($bugsys->in['searchid']) { - $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); + $cachedsearch = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); } else if (bugdar::$userinfo['userid']) { - $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']); + $cachedsearch = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']); } else { @@ -223,7 +223,7 @@ if ($_REQUEST['do'] == 'process') { // force email or name?? make a distinction? // more elegant way to do this? probably - $user = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "' OR displayname LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "%'"); + $user = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "' OR displayname LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "%'"); if ($user['userid']) { $querybuild['reporter'] = "AND bug.userid = $user[userid] OR comment.userid = $user[userid]"; @@ -440,7 +440,7 @@ if ($_REQUEST['do'] == 'process') if ($_REQUEST['do'] == 'update') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); + $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search OR !can_perform('caneditother')) { $message->errorPermission(); @@ -494,7 +494,7 @@ if ($_REQUEST['do'] == 'update') if ($_POST['do'] == 'doupdate') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); + $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search OR !can_perform('caneditother')) { $message->errorPermission(); @@ -573,11 +573,11 @@ if ($_REQUEST['do'] == 'export') { if (!$bugsys->in['searchid'] AND bugdar::$userinfo['userid']) { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']); + $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']); } else if ($bugsys->in['searchid']) { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); + $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); } else { @@ -605,7 +605,7 @@ if ($_REQUEST['do'] == 'export') $xml .= "\n\t\t" . $datef->format('r', $bug['dateline']) . ""; if ($bug['userid']) { - $xml .= "\n\t\t" . construct_user_display($db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $bug[userid]"), false) . ""; + $xml .= "\n\t\t" . construct_user_display($db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $bug[userid]"), false) . ""; } $xml .= "\n\t\t" . $bug['summary'] . ""; $xml .= "\n\t\t" . $bug['product'] . ""; @@ -635,7 +635,7 @@ if ($_REQUEST['do'] == 'export') if ($_POST['do'] == 'dosave') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); + $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search) { $message->addError(T('The search does not exist.')); diff --git a/showhistory.php b/showhistory.php index 4cf44aa..cc5129d 100644 --- a/showhistory.php +++ b/showhistory.php @@ -31,7 +31,7 @@ $focus['showreport'] = 'focus'; require_once('./global.php'); require_once('./includes/api_user.php'); -$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->inputClean('bugid', TYPE_UINT)); +$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->inputClean('bugid', TYPE_UINT)); if (!$bug) { $message->error(L_INVALID_ID); diff --git a/showreport.php b/showreport.php index 27e2c64..f12e90b 100644 --- a/showreport.php +++ b/showreport.php @@ -42,7 +42,7 @@ if (empty($bugid) OR $_REQUEST['do'] == 'quicksearch') { if (!empty($bugid)) { - if ($db->query_first("SELECT bugid FROM " . TABLE_PREFIX . "bug WHERE bugid = $bugid")) + if ($db->queryFirst("SELECT bugid FROM " . TABLE_PREFIX . "bug WHERE bugid = $bugid")) { header("Location: showreport.php?bugid=$bugid"); exit; @@ -61,7 +61,7 @@ if (empty($bugid) OR $_REQUEST['do'] == 'quicksearch') // ------------------------------------------------------------------- // get the report -$bug = $db->query_first(" +$bug = $db->queryFirst(" SELECT bug.*, user.email, user.displayname, user.showemail FROM " . TABLE_PREFIX . "bug AS bug LEFT JOIN " . TABLE_PREFIX . "user AS user @@ -119,7 +119,7 @@ if ($show['edit']) if ($bug['duplicateof']) { - $duplicate = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); + $duplicate = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); } if ($bug['dependency']) @@ -169,7 +169,7 @@ else $assigninfo = bugdar::$datastore['assignto']["$bug[assignedto]"]; $bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assigninfo) : ''); - $duplicateof = $db->query_first("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); + $duplicateof = $db->queryFirst("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); $dupelist = array(); $duplicates = $db->query("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE duplicateof = $bug[bugid]"); @@ -196,7 +196,7 @@ else $show['subscribe'] = can_perform('cansubscribe', $bug['product']); -$favorite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . bugdar::$userinfo['userid']); +$favorite = (bool)$db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . bugdar::$userinfo['userid']); $favoritetext = ($favorite ? T('Remove from Favorites') : T('Add to Favorites')); $bug['userinfo'] = construct_user_display($bug); @@ -277,7 +277,7 @@ if ($show['getattachments'] OR $show['putattachments']) // ------------------------------------------------------------------- // votes -$vote = $db->query_first("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); +$vote = $db->queryFirst("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); $vote['total'] = $vote['votefor'] + $vote['voteagainst']; if ($vote['total'] != 0) diff --git a/userctrl.php b/userctrl.php index a7f01a1..1e48574 100644 --- a/userctrl.php +++ b/userctrl.php @@ -57,7 +57,7 @@ if (empty($_REQUEST['do'])) if ($_POST['do'] == 'killsearch') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); + $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search) { $message->errorPermission(); @@ -72,7 +72,7 @@ if ($_POST['do'] == 'killsearch') if ($_REQUEST['do'] == 'deletesearch') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); + $search = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $input->inputClean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search) { $message->errorPermission(); diff --git a/viewattachment.php b/viewattachment.php index 4ce3fe5..542d720 100755 --- a/viewattachment.php +++ b/viewattachment.php @@ -27,13 +27,13 @@ $focus['showreport'] = 'focus'; require_once('./global.php'); -$attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $input->inputClean('attachmentid', TYPE_UINT)); +$attachment = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $input->inputClean('attachmentid', TYPE_UINT)); if (!$attachment) { $message->error(L_INVALID_ID); } -$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $attachment[bugid]"); +$bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $attachment[bugid]"); if (!check_bug_permissions($bug)) { $message->errorPermission(); diff --git a/vote.php b/vote.php index d0e29a6..aae83eb 100644 --- a/vote.php +++ b/vote.php @@ -36,8 +36,8 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'vote') { - $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->inputClean('bugid', TYPE_UINT)); - $vote = $db->query_first("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); + $bug = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $input->inputClean('bugid', TYPE_UINT)); + $vote = $db->queryFirst("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); if (!check_bug_permissions($bug)) { -- 2.43.5