Skip to content

Commit

Permalink
Don't treat objects like strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Dec 24, 2009
1 parent 057e8d0 commit b16ab9d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/g2_import/helpers/g2_import.php
Expand Up @@ -611,11 +611,9 @@ static function import_tags_for_item(&$queue) {
array("id" => $g2_item_id, "exception" => $e->__toString()));
}

$tags = "";
// Multiword tags have the space changed to dots.s
foreach ($tag_names as $tag_name) {
$tags .= (strlen($tags) ? ", " : "") .
tag::add($g3_item, $tag_name);
tag::add($g3_item, $tag_name);
}

// Tag operations are idempotent so we don't need to map them. Which is good because we don't
Expand All @@ -634,11 +632,10 @@ static function import_keywords_as_tags($keywords, $item) {
$delim = " ";
}

$tags = "";
foreach (preg_split("/$delim/", $keywords) as $keyword) {
$keyword = trim($keyword);
if ($keyword) {
$tags .= (strlen($tags) ? ", " : "") . tag::add($item, $keyword);
tag::add($item, $keyword);
}
}
}
Expand Down

0 comments on commit b16ab9d

Please sign in to comment.