From c6606fd585f3c60b06995c78062cfadc18165de2 Mon Sep 17 00:00:00 2001 From: plegall Date: Fri, 19 Apr 2013 20:19:15 +0000 Subject: merge r22301 from branch 2.5 to trunk bug 2892 fixed: no more error when tag_ids input parameter is empty (but provided) on pwg.images.setInfo. git-svn-id: http://piwigo.org/svn/trunk@22302 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_functions.inc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include/ws_functions.inc.php') diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index c0a0be246..73f8e9942 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -2620,7 +2620,17 @@ SELECT * // and now, let's create tag associations if (isset($params['tag_ids'])) { - $tag_ids = explode(',', $params['tag_ids']); + $tag_ids = array(); + + foreach (explode(',', $params['tag_ids']) as $candidate) + { + $candidate = trim($candidate); + + if (preg_match(PATTERN_ID, $candidate)) + { + $tag_ids[] = $candidate; + } + } if ('replace' == $params['multiple_value_mode']) { -- cgit v1.2.3