diff --git a/phpBB/phpbb/storage/storage.php b/phpBB/phpbb/storage/storage.php index b9c20ed7cf..f2fabdcb94 100644 --- a/phpBB/phpbb/storage/storage.php +++ b/phpBB/phpbb/storage/storage.php @@ -154,7 +154,7 @@ class storage */ public function exists($path) { - return $this->get_adapter()->exists($path); + return $this->is_tracked($path); } /** @@ -376,6 +376,23 @@ class storage $this->cache->destroy('_storage_' . $this->get_name() . '_numfiles'); } + public function is_tracked($path) + { + $sql_ary = array( + 'file_path' => $path, + 'storage' => $this->get_name(), + ); + + // Get file, if exist update filesize, if not add new record + $sql = 'SELECT file_id FROM ' . $this->storage_table . ' + WHERE ' . $this->db->sql_build_array('SELECT', $sql_ary); + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + return ($row) ? true : false; + } + /** * Rename tracked file *