summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2010-02-06 13:05:44 -0800
committerAndy Staudacher <andy.st@gmail.com>2010-02-06 13:05:44 -0800
commit7099fc71f11ef8d3dd613d96a04a4824a827c714 (patch)
tree56a0cdde8af26c66b27095f15107294c9c75a52c /modules/tag/helpers
parent5c0c33782d7dd3556adecb9593f25f2cff06401a (diff)
Fix for ticket 1004: Replace all uses of split with explode (none actually required regular expressions). Thanks to Brian Hartsock for providing a patch!
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/tag_event.php6
-rw-r--r--modules/tag/helpers/tag_item_rest.php2
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index 403ccd52..10075c02 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -34,7 +34,7 @@ class tag_event_Core {
if (!empty($iptc["2#025"])) {
foreach($iptc["2#025"] as $tag) {
$tag = str_replace("\0", "", $tag);
- foreach (preg_split("/,/", $tag) as $word) {
+ foreach (explode(",", $tag) as $word) {
$word = trim($word);
if (function_exists("mb_detect_encoding") && mb_detect_encoding($word) != "UTF-8") {
$word = utf8_encode($word);
@@ -82,7 +82,7 @@ class tag_event_Core {
static function item_edit_form_completed($item, $form) {
tag::clear_all($item);
- foreach (preg_split("/,/", $form->edit_item->tags->value) as $tag_name) {
+ foreach (explode(",", $form->edit_item->tags->value) as $tag_name) {
if ($tag_name) {
tag::add($item, trim($tag_name));
}
@@ -124,7 +124,7 @@ class tag_event_Core {
}
static function add_photos_form_completed($album, $form) {
- foreach (split(",", $form->add_photos->tags->value) as $tag_name) {
+ foreach (explode(",", $form->add_photos->tags->value) as $tag_name) {
$tag_name = trim($tag_name);
if ($tag_name) {
$tag = tag::add($album, $tag_name);
diff --git a/modules/tag/helpers/tag_item_rest.php b/modules/tag/helpers/tag_item_rest.php
index 672cec53..fe07fefb 100644
--- a/modules/tag/helpers/tag_item_rest.php
+++ b/modules/tag/helpers/tag_item_rest.php
@@ -34,7 +34,7 @@ class tag_item_rest_Core {
}
static function resolve($tuple) {
- list ($tag_id, $item_id) = split(",", $tuple);
+ list ($tag_id, $item_id) = explode(",", $tuple);
$tag = ORM::factory("tag", $tag_id);
$item = ORM::factory("item", $item_id);
if (!$tag->loaded() || !$item->loaded() || !$tag->has($item) || !access::can("view", $item)) {