diff options
author | Nils Adermann <naderman@naderman.de> | 2006-11-12 14:29:32 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2006-11-12 14:29:32 +0000 |
commit | cf34efb06ce62407232d63dd4e73b8afc6e2a4ef (patch) | |
tree | 59501fb88bc314e1fd63c122990d35eb9dc96a7f /phpBB/includes/functions.php | |
parent | fa9d7e4ab47cf3655617a815adcfa369ae0e8706 (diff) | |
download | forums-cf34efb06ce62407232d63dd4e73b8afc6e2a4ef.tar forums-cf34efb06ce62407232d63dd4e73b8afc6e2a4ef.tar.gz forums-cf34efb06ce62407232d63dd4e73b8afc6e2a4ef.tar.bz2 forums-cf34efb06ce62407232d63dd4e73b8afc6e2a4ef.tar.xz forums-cf34efb06ce62407232d63dd4e73b8afc6e2a4ef.zip |
message
git-svn-id: file:///svn/phpbb/trunk@6569 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 48b64f8092..17c15fda30 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2085,7 +2085,7 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po * Generates a text with approx. the specified length which contains the specified words and their context * * @param string $text The full text from which context shall be extracted -* @param string $words An array of words which should be contained in the result, * is allowed as a wildcard +* @param string $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!) * @param int $length The desired length of the resulting text, however the result might be shorter or longer than this value * * @return string Context of the specified words seperated by "..." @@ -2102,7 +2102,7 @@ function get_context($text, $words, $length = 400) // find the starting indizes of all words foreach ($words as $word) { - if (preg_match('#(?:[^\w]|^)(' . str_replace('\*', '\w*?', preg_quote($word, '#')) . ')(?:[^\w]|$)#i', $text, $match)) + if (preg_match('#(?:[^\w]|^)(' . $word . ')(?:[^\w]|$)#i', $text, $match)) { $pos = strpos($text, $match[1]); if ($pos !== false) |