whitespace and fixup problem with blank string

darcs-hash:20081124150638-5ed1f-994af62567660c7f09985bf449a344df104548eb.gz
This commit is contained in:
Evan Prodromou 2008-11-24 10:06:38 -05:00
parent 07c4547a2f
commit 138b1b2767

View File

@ -121,13 +121,19 @@ class TagotherAction extends Action {
return;
}
$tags = array_map('common_canonical_tag', preg_split('/[\s,]+/', $tagstring));
if (is_string($tagstring) && strlen($tagstring) > 0) {
foreach ($tags as $tag) {
if (!common_valid_profile_tag($tag)) {
$this->show_form($profile, sprintf(_('Invalid tag: "%s"'), $tag));
return;
$tags = array_map('common_canonical_tag',
preg_split('/[\s,]+/', $tagstring));
foreach ($tags as $tag) {
if (!common_valid_profile_tag($tag)) {
$this->show_form($profile, sprintf(_('Invalid tag: "%s"'), $tag));
return;
}
}
} else {
$tags = array();
}
$user = common_current_user();