aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-05-30 21:38:17 +0000
committerplegall <plg@piwigo.org>2011-05-30 21:38:17 +0000
commit8290d353d8c3394d6c0dbb1369e6c32c14054b08 (patch)
treeaa11339fd8a93f49b1fed4cace5e1584002cc84c /include/ws_functions.inc.php
parent00b29da491d774aa430fdac96a194cfe3705363c (diff)
bug 2299 fixed: web API, method pwg.images.addSimple returns a clean error when parameter "image" is missing
git-svn-id: http://piwigo.org/svn/branches/2.2@11117 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions.inc.php')
-rw-r--r--include/ws_functions.inc.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index ef592b3a4..2fff3c88a 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -1419,6 +1419,11 @@ function ws_images_addSimple($params, &$service)
{
return new PwgError(405, "This method requires HTTP POST");
}
+
+ if (!isset($_FILES['image']))
+ {
+ return new PwgError(405, "The image (file) parameter is missing");
+ }
$params['image_id'] = (int)$params['image_id'];
if ($params['image_id'] > 0)