summaryrefslogtreecommitdiffstats
path: root/system/helpers/text_helper.php
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2008-10-17 10:13:55 +0200
committerRick Ellis <rick.ellis@ellislab.com>2008-10-17 10:13:55 +0200
commit87da39a77bce2660e77565136de0530b757267cb (patch)
tree85266b8858d27f27b6b7bacee83801071da042a1 /system/helpers/text_helper.php
parent1e2c33ef74005b25530a201b44bb95b7fbf26d19 (diff)
Fixed a preg_replace bug if the supplied string contains the delimiter
Diffstat (limited to 'system/helpers/text_helper.php')
-rw-r--r--system/helpers/text_helper.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 9f13896ae..8a4460825 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -236,11 +236,11 @@ if ( ! function_exists('word_censor'))
{
if ($replacement != '')
{
- $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/i", $replacement, $str);
+ $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword, '/')).")\b/i", $replacement, $str);
}
else
{
- $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/ie", "str_repeat('#', strlen('\\1'))", $str);
+ $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword, '/')).")\b/ie", "str_repeat('#', strlen('\\1'))", $str);
}
}