From c81ee12411af5d26bbe4fe413ea7f6728d047ace Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 17 Mar 2009 20:57:51 +0000 Subject: Don't allow empty tag names --- modules/tag/helpers/tag.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules') diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 3c35a191..cedf307e 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -29,6 +29,10 @@ class tag_Core { * @throws Exception("@todo {$tag_name} WAS_NOT_ADDED_TO {$item->id}") */ static function add($item, $tag_name) { + if (empty($tag_name)) { + throw new exception("@todo MISSING_TAG_NAME"); + } + $tag = ORM::factory("tag")->where("name", $tag_name)->find(); if (!$tag->loaded) { $tag->name = $tag_name; -- cgit v1.2.3