]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix potential infinite loop
authorRobin Appelman <icewind1991@gmail.com>
Sun, 4 Jul 2010 07:54:54 +0000 (09:54 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sun, 4 Jul 2010 07:54:54 +0000 (09:54 +0200)
inc/HTTP/WebDAV/Server/Filesystem.php

index 000831f6fefc5f359d5bf652b3e5e1f78282d8bd..7826a690a555adec2712a423dc5d5dd934338e7e 100755 (executable)
             $info["props"][] = $this->mkprop("resourcetype", "");
             if ( OC_FILESYSTEM::is_readable($fspath)) {
                 $info["props"][] = $this->mkprop("getcontenttype", $this->_mimetype($fspath));
-            } else {
+            } else { "SELECT ns, name, value FROM properties WHERE path = '$path'";
                 $info["props"][] = $this->mkprop("getcontenttype", "application/x-non-readable");
             }               
             $info["props"][] = $this->mkprop("getcontentlength",  OC_FILESYSTEM::filesize($fspath));
         }
         // get additional properties from database
-            $query = "SELECT ns, name, value FROM properties WHERE path = '$path'";
-            $res = OC_DB::select($query);
-            while ($row = $res[0]) {
+               $query = "SELECT ns, name, value FROM properties WHERE path = '$path'";
+               $res = OC_DB::select($query);
+               foreach($res as $row){
             $info["props"][] = $this->mkprop($row["ns"], $row["name"], $row["value"]);
         }
         return $info;