Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parameter count to TicketLock::lookup #878

Merged
merged 2 commits into from
Jan 18, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/ajax.tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function search() {
function acquireLock($tid) {
global $cfg,$thisstaff;

if(!$tid or !is_numeric($tid) or !$thisstaff or !$cfg or !$cfg->getLockTime())
if(!$tid || !is_numeric($tid) || !$thisstaff || !$cfg || !$cfg->getLockTime())
return 0;

if(!($ticket = Ticket::lookup($tid)) || !$ticket->checkStaffAccess($thisstaff))
Expand All @@ -218,10 +218,10 @@ function acquireLock($tid) {
function renewLock($tid, $id) {
global $thisstaff;

if(!$id or !is_numeric($id) or !$thisstaff)
if(!$tid || !is_numeric($tid) || !$id || !is_numeric($id) || !$thisstaff)
return $this->json_encode(array('id'=>0, 'retry'=>true));

$lock= TicketLock::lookup($id);
$lock= TicketLock::lookup($id, $tid);
if(!$lock || !$lock->getStaffId() || $lock->isExpired()) //Said lock doesn't exist or is is expired
return self::acquireLock($tid); //acquire the lock

Expand Down