Skip to content
Snippets Groups Projects
Commit 5f78d143 authored by Steven Wittens's avatar Steven Wittens
Browse files

#16993: Bad query in upload.

parent 77fbe802
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -91,7 +91,7 @@ function upload_download() { ...@@ -91,7 +91,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(db_rewrite_sql("SELECT f.nid, * from {files} f WHERE filepath = '%s", 'f'), $file); $result = db_query(db_rewrite_sql("SELECT f.nid, f.* 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.
......
...@@ -91,7 +91,7 @@ function upload_download() { ...@@ -91,7 +91,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(db_rewrite_sql("SELECT f.nid, * from {files} f WHERE filepath = '%s", 'f'), $file); $result = db_query(db_rewrite_sql("SELECT f.nid, f.* 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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment