aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorflop25 <flop25@piwigo.org>2013-02-18 18:55:16 +0000
committerflop25 <flop25@piwigo.org>2013-02-18 18:55:16 +0000
commitd02cc8f1d825de35a9bb90c1ac25c5786a83ac3c (patch)
tree30af7b1f5ed65746aacab740d8ac5cf5d32c7250 /include
parent75fa687b88f09f12dd75691837b252545206df75 (diff)
bug:2845
added 'tags' as potential array for pwg.images.addSimple git-svn-id: http://piwigo.org/svn/trunk@20814 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/ws_functions.inc.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index 7f0952ec3..199175bb7 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -1977,11 +1977,22 @@ SELECT *
if (isset($params['tags']) and !empty($params['tags']))
{
$tag_ids = array();
- $tag_names = preg_split('~(?<!\\\),~', $params['tags']);
- foreach ($tag_names as $tag_name)
+ if (is_array($params[tags]))
{
- $tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
- array_push($tag_ids, $tag_id);
+ foreach ($params[tags] as $tag_name)
+ {
+ $tag_id = tag_id_from_tag_name($tag_name);
+ array_push($tag_ids, $tag_id);
+ }
+ }
+ else
+ {
+ $tag_names = preg_split('~(?<!\\\),~', $params['tags']);
+ foreach ($tag_names as $tag_name)
+ {
+ $tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
+ array_push($tag_ids, $tag_id);
+ }
}
add_tags($tag_ids, array($image_id));