[SPIP] ~maj 3.0.10 --> 3.0.14
[lhc/web/www.git] / www / plugins-dist / medias / action / acceder_document.php
index 485568b..c5eba15 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2013                                                *
+ *  Copyright (c) 2001-2014                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -36,8 +36,8 @@ function action_acceder_document_dist() {
        else if (!file_exists($file) OR !is_readable($file)) {
                $status = 404;
        } else {
-               $where = "documents.fichier=".sql_quote(set_spip_doc($file))
-               . ($arg ? " AND documents.id_document=".intval($arg): '');
+               $where = "D.fichier=".sql_quote(set_spip_doc($file))
+               . ($arg ? " AND D.id_document=".intval($arg): '');
 
                $doc = sql_fetsel("D.id_document, D.titre, D.fichier, T.mime_type, T.inclus, D.extension", "spip_documents AS D LEFT JOIN spip_types_documents AS T ON D.extension=T.extension",$where);
                if (!$doc) {