From c102bec02311a093030b353d6ea8b8eed0a85885 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 10 Jun 2006 20:16:02 +0000 Subject: try to prevent re-parsing of parsed bbcode content git-svn-id: file:///svn/phpbb/trunk@6043 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bcf783090f..66903cc2c9 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -352,6 +352,30 @@ if (!function_exists('str_split')) } } +if (!function_exists('stripos')) +{ + /** + * A wrapper for the PHP5 function stripos + * Find position of first occurrence of a case-insensitive string + * + * @param string $haystack is the string to search in + * @param string needle is the string to search for + * + * @return Returns the numeric position of the first occurrence of needle in the haystack string. Unlike strpos(), stripos() is case-insensitive. + * Note that the needle may be a string of one or more characters. + * If needle is not found, stripos() will return boolean FALSE. + */ + function stripos($haystack, $needle) + { + if (preg_match('#' . preg_quote($needle, '#') . '#i', $haystack, $m)) + { + return strpos($haystack, $m[0]); + } + + return false; + } +} + // functions used for building option fields /** -- cgit v1.2.1