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
$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']));
// -------------------------------------------------------------------
$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')));
'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)
{
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);
{
$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);
$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);
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']);
}
$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();
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);
}
// 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
$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))
{
}
// 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
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
$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
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
// 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']);
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();
$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']);
if ($bugsys->in['step'] == 0)
{
- $collation = $db->query_first("SHOW VARIABLES LIKE 'collation_database'");
+ $collation = $db->queryFirst("SHOW VARIABLES LIKE 'collation_database'");
echo '<h1>Convert Database Character Set</h1>';
echo '<p>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 <strong>' . TARGET . '</strong>. This script can migrate all of data from your current character set/collation of <strong>' . $collation['Value'] . '</strong>. If you would like to convert your database to utf8, please click the link below.</p>';
{
$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[#]')
build_automations();
echo "Rebuilding the automations cahce<br />\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.
$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);
$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.'));
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']);
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));
}
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
{
{
// 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]";
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();
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();
{
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
{
$xml .= "\n\t\t<dateReported>" . $datef->format('r', $bug['dateline']) . "</dateReported>";
if ($bug['userid'])
{
- $xml .= "\n\t\t<reporter>" . construct_user_display($db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $bug[userid]"), false) . "</reporter>";
+ $xml .= "\n\t\t<reporter>" . construct_user_display($db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $bug[userid]"), false) . "</reporter>";
}
$xml .= "\n\t\t<summary>" . $bug['summary'] . "</summary>";
$xml .= "\n\t\t<product>" . $bug['product'] . "</product>";
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.'));
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);
{
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;
// -------------------------------------------------------------------
// 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
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'])
$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]");
$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);
// -------------------------------------------------------------------
// 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)
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();
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();
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();
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))
{