Commit 37f6473a authored by Dries's avatar Dries

- Patch #16023 by chx: the upload.module still used the old node_access_*_sql calls.
parent 1f54afa5
...@@ -90,7 +90,7 @@ function upload_download() { ...@@ -90,7 +90,7 @@ function upload_download() {
function upload_file_download($file) { function upload_file_download($file) {
if (user_access('view uploaded files')) { if (user_access('view uploaded files')) {
$file = file_create_path($file); $file = file_create_path($file);
$result = db_query("SELECT * from {files} n " . node_access_join_sql() . " WHERE filepath = '%s' AND ". node_access_where_sql(), $file); $result = db_query(node_rewrite_sql("SELECT f.nid, * from {files} f WHERE filepath = '%s", 'f'), $file);
if ($file = db_fetch_object($result)) { if ($file = db_fetch_object($result)) {
$name = mime_header_encode($file->filename); $name = mime_header_encode($file->filename);
// Serve images and text inline for the browser to display rather than download. // Serve images and text inline for the browser to display rather than download.
......
...@@ -90,7 +90,7 @@ function upload_download() { ...@@ -90,7 +90,7 @@ function upload_download() {
function upload_file_download($file) { function upload_file_download($file) {
if (user_access('view uploaded files')) { if (user_access('view uploaded files')) {
$file = file_create_path($file); $file = file_create_path($file);
$result = db_query("SELECT * from {files} n " . node_access_join_sql() . " WHERE filepath = '%s' AND ". node_access_where_sql(), $file); $result = db_query(node_rewrite_sql("SELECT f.nid, * from {files} f WHERE filepath = '%s", 'f'), $file);
if ($file = db_fetch_object($result)) { if ($file = db_fetch_object($result)) {
$name = mime_header_encode($file->filename); $name = mime_header_encode($file->filename);
// Serve images and text inline for the browser to display rather than download. // Serve images and text inline for the browser to display rather than download.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment