From 3d4a6d6336a2eaa212878f8af788825256be9e9c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 Jan 2010 21:14:40 -0800 Subject: Remove unused untagging code from put() Add access permissions to delete() Remove unnecessary return value from delete() --- modules/tag/helpers/tag_rest.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag_rest.php b/modules/tag/helpers/tag_rest.php index e7be9afa..0226c6d3 100644 --- a/modules/tag/helpers/tag_rest.php +++ b/modules/tag/helpers/tag_rest.php @@ -43,19 +43,6 @@ class tag_rest_Core { static function put($request) { $tag = rest::resolve($request->url); - - if (isset($request->params->remove)) { - if (!is_array($request->params->remove)) { - throw new Exception("Bad request", 400); - } - - foreach ($request->params->remove as $item_url) { - $item = rest::resolve($item_url); - access::required("edit", $item); - $tag->remove($item); - } - } - if (isset($request->params->name)) { $tag->name = $request->params->name; } @@ -73,11 +60,10 @@ class tag_rest_Core { } else { // Remove an item from the tag $item = rest::resolve($request->params->url); + access::required("edit", $item); $tag->remove($item); $tag->save(); - tag::compact(); - return array("url" => rest::url("tag", $tag)); } } -- cgit v1.2.3