Admin/AjaxHandler

* removed rogue \s, which prevented handling of id-lists
 * affected mass handling of screenshots and comments
This commit is contained in:
Sarjuuk
2015-12-06 11:21:38 +01:00
parent f01c624f82
commit 4daf474ff4
3 changed files with 6 additions and 6 deletions

View File

@@ -172,6 +172,9 @@ class AjaxAdmin extends AjaxHandler
if (!$this->_get['id'])
return '';
// approve soon to be sticky screenshots
$this->ssApprove();
// this one is a bit strange: as far as i've seen, the only thing a 'sticky' screenshot does is show up in the infobox
// this also means, that only one screenshot per page should be sticky
// so, handle it one by one and the last one affecting one particular type/typId-key gets the cake
@@ -180,9 +183,6 @@ class AjaxAdmin extends AjaxHandler
// reset all others
DB::Aowow()->query('UPDATE ?_screenshots a, ?_screenshots b SET a.status = a.status & ~?d WHERE a.type = b.type AND a.typeId = b.typeId AND a.id <> b.id AND b.id = ?d', CC_FLAG_STICKY, $id);
// approve this one (if not already)
$this->ssApprove([$id]);
// toggle sticky status
DB::Aowow()->query('UPDATE ?_screenshots SET `status` = IF(`status` & ?d, `status` & ~?d, `status` | ?d) WHERE id = ?d AND `status` & ?d', CC_FLAG_STICKY, CC_FLAG_STICKY, CC_FLAG_STICKY, $id, CC_FLAG_APPROVED);
}
@@ -312,7 +312,7 @@ class AjaxAdmin extends AjaxHandler
if ($this->params[0] == 'screenshots')
{
if (preg_match('/\d+(,\d+)*/', $val))
return array_map('intVal', explode(', ', $val));
return array_map('intVal', explode(',', $val));
return null;
}