1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +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

View File

@@ -4203,10 +4203,13 @@ class e_admin_ui extends e_admin_controller_ui
{ {
list($tmp,$id) = explode("-", $row, 2); 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; $updated[] = $id;
} }
echo($sql->getLastQuery()."\n");
$c++; $c++;
} }
//echo "Updated ".implode(",",$updated); //echo "Updated ".implode(",",$updated);