Skip to content
Snippets Groups Projects
Commit 26612e9c authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#54298, Only user = 1 can upload files, patch by dopry

parent d12faf54
No related branches found
No related tags found
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
...@@ -249,6 +249,8 @@ function _upload_validate(&$node) { ...@@ -249,6 +249,8 @@ function _upload_validate(&$node) {
if (is_array($node->files)) { if (is_array($node->files)) {
// Update existing files with form data. // Update existing files with form data.
foreach($node->files as $fid => $file) { foreach($node->files as $fid => $file) {
// Convert file to object for compatability
$file = (object)$file;
// Validate new uploads. // Validate new uploads.
if (strpos($fid, 'upload') !== false && !$file->remove) { if (strpos($fid, 'upload') !== false && !$file->remove) {
......
...@@ -249,6 +249,8 @@ function _upload_validate(&$node) { ...@@ -249,6 +249,8 @@ function _upload_validate(&$node) {
if (is_array($node->files)) { if (is_array($node->files)) {
// Update existing files with form data. // Update existing files with form data.
foreach($node->files as $fid => $file) { foreach($node->files as $fid => $file) {
// Convert file to object for compatability
$file = (object)$file;
// Validate new uploads. // Validate new uploads.
if (strpos($fid, 'upload') !== false && !$file->remove) { if (strpos($fid, 'upload') !== false && !$file->remove) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment