Browse Source

Merge pull request #36 from banditsmile/bugfix/bandit/compress_update

数据库更新bug修复
pull/39/merge
xiaoz 6 years ago committed by GitHub
parent
commit
72c1b3abab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      application/models/Update.php

6
application/models/Update.php

@ -22,7 +22,7 @@
public function compress($id){ public function compress($id){
$id = strip_tags($id); $id = strip_tags($id);
$id = (int)$id; $id = (int)$id;
$sql = "UPDATE img_images SET `compression` = 1"; $sql = "UPDATE img_images SET `compression` = 1 WHERE imgid={$id}";
$query = $this->db->query($sql); $query = $this->db->query($sql);
if($query){ if($query){
return TRUE; return TRUE;
@ -33,9 +33,9 @@
} }
//更新站点信息 //更新站点信息
public function site($name,$data){ public function site($name,$data){
$id = strip_tags($name); $name = strip_tags($name);
$sql = "UPDATE img_options SET `values` = '$data' WHERE `name` = '$name'"; $sql = "UPDATE img_options SET `values` = '$data' WHERE `name` = '{$name}'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
if($query){ if($query){
return TRUE; return TRUE;

Loading…
Cancel
Save