/** * Check if the same virtual hash exists more than once * in the database. If so, this means the file * is already uploaded as unencrypted. * * @return boolean */ protected function linkedRecords() { $sql = sprintf("SELECT\n COUNT(1) AS count\n FROM \n %sfaqattachment\n WHERE virtual_hash = '%s'", SQLPREFIX, $this->virtualHash); $result = $this->db->query($sql); if ($result) { $assoc = $this->db->fetch_assoc($result); } return $assoc['count'] > 1; }