1
0
mirror of https://github.com/e107inc/e107.git synced 2025-05-04 11:24:54 +02:00

Admin UI ajax sort supports no numerical primary IDs now

This commit is contained in:
SecretR 2013-02-06 19:47:42 +02:00
parent da62465879
commit 3b78d19acb

@ -4203,10 +4203,13 @@ class e_admin_ui extends e_admin_controller_ui
{
list($tmp,$id) = explode("-", $row, 2);
if($sql->db_Update($this->table, $this->sortField." = ".intval($c)." WHERE ".$this->pid." = ".intval($id)))
$id = preg_replace('/[^\w\-]/', '', $id);
if(!is_numeric($id)) $id = "'{$id}'";
if($sql->db_Update($this->table, $this->sortField." = {$c} WHERE ".$this->pid." = ".$id))
{
$updated[] = $id;
}
echo($sql->getLastQuery()."\n");
$c++;
}
//echo "Updated ".implode(",",$updated);