diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-03-17 20:57:51 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-17 20:57:51 +0000 |
commit | c81ee12411af5d26bbe4fe413ea7f6728d047ace (patch) | |
tree | 1e9197f1d24b6da7ade225d77f232eda7f4bb686 /modules | |
parent | 208fc9db683c51e3bcf1f24d1e5e0200e0f32d96 (diff) |
Don't allow empty tag names
Diffstat (limited to 'modules')
-rw-r--r-- | modules/tag/helpers/tag.php | 4 |
1 files changed, 4 insertions, 0 deletions
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; |