summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/taxonomy/taxonomy.module8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 45876d794..1d713145e 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -685,8 +685,8 @@ function taxonomy_form_alter($form_id, &$form) {
if ($term->vid == $vocabulary->vid) {
// Commas and quotes in terms are special cases, so encode 'em.
- if (preg_match('/,/', $term->name) || preg_match('/"/', $term->name)) {
- $term->name = '"'.preg_replace('/"/', '""', $term->name).'"';
+ if (strpos($term->name, ',') !== FALSE || strpos($term->name, '"') !== FALSE) {
+ $term->name = '"'.str_replace('"', '""', $term->name).'"';
}
$typed_terms[] = $term->name;
@@ -1480,8 +1480,8 @@ function taxonomy_autocomplete($vid, $string = '') {
while ($tag = db_fetch_object($result)) {
$n = $tag->name;
// Commas and quotes in terms are special cases, so encode 'em.
- if (preg_match('/,/', $tag->name) || preg_match('/"/', $tag->name)) {
- $n = '"'. preg_replace('/"/', '""', $tag->name) .'"';
+ if (strpos($tag->name, ',') !== FALSE || strpos($tag->name, '"') !== FALSE) {
+ $n = '"'. str_replace('"', '""', $tag->name) .'"';
}
$matches[$prefix . $n] = check_plain($tag->name);
}