summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/taxonomy.module6
-rw-r--r--modules/taxonomy/taxonomy.module6
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index d7a0c244d..150acf060 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -206,8 +206,10 @@ function taxonomy_save_term($edit) {
// synonyms (very cool idea indeed)
db_query("DELETE FROM term_synonym WHERE tid = '%d'", $edit["tid"]);
if ($edit["synonyms"]) {
- foreach (explode ("\n", $edit["synonyms"]) as $synonym) {
- db_query("INSERT INTO term_synonym (tid, name) VALUES ('%d', '%s')", $edit["tid"], chop($synonym));
+ foreach (explode ("\n", str_replace("\r", "", $edit["synonyms"])) as $synonym) {
+ if ($synonym) {
+ db_query("INSERT INTO term_synonym (tid, name) VALUES ('%d', '%s')", $edit["tid"], chop($synonym));
+ }
}
}
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index d7a0c244d..150acf060 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -206,8 +206,10 @@ function taxonomy_save_term($edit) {
// synonyms (very cool idea indeed)
db_query("DELETE FROM term_synonym WHERE tid = '%d'", $edit["tid"]);
if ($edit["synonyms"]) {
- foreach (explode ("\n", $edit["synonyms"]) as $synonym) {
- db_query("INSERT INTO term_synonym (tid, name) VALUES ('%d', '%s')", $edit["tid"], chop($synonym));
+ foreach (explode ("\n", str_replace("\r", "", $edit["synonyms"])) as $synonym) {
+ if ($synonym) {
+ db_query("INSERT INTO term_synonym (tid, name) VALUES ('%d', '%s')", $edit["tid"], chop($synonym));
+ }
}
}