diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-25 12:41:41 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-25 12:41:41 +0000 |
| commit | 70889081f13417dbcbaf2a4d9076146d596a1235 (patch) | |
| tree | 9d46d73fd6e2326a0ff9b086d7c58ffc263602b4 /phpBB | |
| parent | 5b176a2effab90fa28a91fbbd9821453d562d1b1 (diff) | |
| download | forums-70889081f13417dbcbaf2a4d9076146d596a1235.tar forums-70889081f13417dbcbaf2a4d9076146d596a1235.tar.gz forums-70889081f13417dbcbaf2a4d9076146d596a1235.tar.bz2 forums-70889081f13417dbcbaf2a4d9076146d596a1235.tar.xz forums-70889081f13417dbcbaf2a4d9076146d596a1235.zip | |
Move phpbb_preg_quote back into functions because it's plain annoying ... :D
git-svn-id: file:///svn/phpbb/trunk@2427 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/bbcode.php | 19 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 12 |
2 files changed, 13 insertions, 18 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index dd46f94d34..c90ab8145a 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -764,22 +764,5 @@ function smiley_sort($a, $b) return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1; } -// -// this does exactly what preg_quote() does in PHP 4-ish: -// http://www.php.net/manual/en/function.preg-quote.php -// -// This function is here because the 2nd paramter to preg_quote was added in some -// version of php 4.0.x.. So we use this in order to maintain compatibility with -// earlier versions of PHP. -// -// If you just need the 1-parameter preg_quote call, then don't bother using this. -// -function phpbb_preg_quote($str, $delimiter) -{ - $text = preg_quote($str); - $text = str_replace($delimiter, "\\" . $delimiter, $text); - - return $text; -} -?> +?>
\ No newline at end of file diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7be4eb6342..602d241578 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -423,6 +423,18 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add } // +// This does exactly what preg_quote() does in PHP 4-ish +// If you just need the 1-parameter preg_quote call, then don't bother using this. +// +function phpbb_preg_quote($str, $delimiter) +{ + $text = preg_quote($str); + $text = str_replace($delimiter, "\\" . $delimiter, $text); + + return $text; +} + +// // Obtain list of naughty words and build preg style replacement arrays for use by the // calling script, note that the vars are passed as references this just makes it easier // to return both sets of arrays |
