]> source.dussan.org Git - nextcloud-server.git/commitdiff
escape all identifiers with backticks
authorjfd <jfd@underverse>
Mon, 30 Jul 2012 18:46:14 +0000 (20:46 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Fri, 24 Aug 2012 13:08:57 +0000 (15:08 +0200)
lib/filecache.php

index 9e999f1298907ccdbd68fe2d784263a140eb17b3..719f419b37cac57d89c1efebc861da6d09cf772b 100644 (file)
@@ -59,7 +59,7 @@ class OC_FileCache{
                        $root='';
                }
                $path=$root.$path;
-               $query=OC_DB::prepare('SELECT ctime,mtime,mimetype,size,encrypted,versioned,writable FROM *PREFIX*fscache WHERE path_hash=?');
+               $query=OC_DB::prepare('SELECT `ctime`,`mtime`,`mimetype`,`size`,`encrypted`,`versioned`,`writable` FROM `*PREFIX*fscache` WHERE `path_hash`=?');
                $result=$query->execute(array(md5($path)))->fetchRow();
                if(is_array($result)){
                        return $result;
@@ -206,12 +206,12 @@ class OC_FileCache{
                        $path=$root.$file;
                        self::delete(self::getFileId($path));
                }elseif($file!=-1){
-                       $query=OC_DB::prepare('SELECT id FROM *PREFIX*fscache WHERE parent=?');
+                       $query=OC_DB::prepare('SELECT `id` FROM `*PREFIX*fscache` WHERE `parent`=?');
                        $result=$query->execute(array($file));
                        while($child=$result->fetchRow()){
                                self::delete(intval($child['id']));
                        }
-                       $query=OC_DB::prepare('DELETE FROM *PREFIX*fscache WHERE id=?');
+                       $query=OC_DB::prepare('DELETE FROM `*PREFIX*fscache` WHERE `id`=?');
                        $query->execute(array($file));
                }
        }