summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-07-31 16:42:48 +0400
committerAndrew Dolgov <[email protected]>2013-07-31 16:42:48 +0400
commita447f4e40aac4210c9b7d3c7a9942a7c798a1695 (patch)
tree22403542d60eeaa21ea5f52fca05d06dead60f3b /include
parent34dad844147c5ee46cbdba310a36173244a0ff11 (diff)
term highlighting in content: use mb functions
Diffstat (limited to 'include')
-rw-r--r--include/functions.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/functions.php b/include/functions.php
index 5b7521249..3aaccbb19 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -2875,14 +2875,14 @@
$text = $child->textContent;
$stubs = array();
- while (($pos = stripos($text, $word)) !== false) {
- $fragment->appendChild(new DomText(substr($text, 0, $pos)));
- $word = substr($text, $pos, strlen($word));
+ while (($pos = mb_stripos($text, $word)) !== false) {
+ $fragment->appendChild(new DomText(mb_substr($text, 0, $pos)));
+ $word = mb_substr($text, $pos, mb_strlen($word));
$highlight = $doc->createElement('span');
$highlight->appendChild(new DomText($word));
$highlight->setAttribute('class', 'highlight');
$fragment->appendChild($highlight);
- $text = substr($text, $pos + strlen($word));
+ $text = mb_substr($text, $pos + mb_strlen($word));
}
if (!empty($text)) $fragment->appendChild(new DomText($text));