diff options
author | Rick Ellis <rick.ellis@ellislab.com> | 2008-10-17 10:13:55 +0200 |
---|---|---|
committer | Rick Ellis <rick.ellis@ellislab.com> | 2008-10-17 10:13:55 +0200 |
commit | 87da39a77bce2660e77565136de0530b757267cb (patch) | |
tree | 85266b8858d27f27b6b7bacee83801071da042a1 | |
parent | 1e2c33ef74005b25530a201b44bb95b7fbf26d19 (diff) |
Fixed a preg_replace bug if the supplied string contains the delimiter
-rw-r--r-- | system/helpers/text_helper.php | 4 |
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);
}
}
|