From 8dc92c484cd3aa218a03e5611afe22300d708cf9 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 8 Feb 2019 07:57:07 +0100 Subject: [PATCH] Image uploader fixes --- debian/changelog | 2 +- package.json | 2 +- rest/image/upload.php | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0dd7aa90..f639fa51 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.406.29) stable; urgency=low +hedera-web (1.406.30) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 8d3914f3..58e0b23d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.406.29", + "version": "1.406.30", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/image/upload.php b/rest/image/upload.php index 11b9ba92..5c72ec46 100644 --- a/rest/image/upload.php +++ b/rest/image/upload.php @@ -11,8 +11,7 @@ use Vn\Lib\UserException; class Upload extends Vn\Web\JsonRequest { const PARAMS = [ 'name', - 'schema', - 'updateMatching' + 'schema' ]; function run($db) { @@ -80,6 +79,9 @@ class Upload extends Vn\Web\JsonRequest { $schema = $db->quote($info['schema']); $table = $db->quote($info['table']); $column = $db->quote($info['column']); + + if (!($schema && $table && column)) + throw new UserException(s('Cannot update matching id')); $pk = $db->getRow ("SHOW INDEX FROM $schema.$table WHERE Key_name = 'PRIMARY'"); if (!pk) throw new UserException(s('Cannot update matching id'));