diff --git a/lib/classes/caption/Field/Value.php b/lib/classes/caption/Field/Value.php index 81e9f67dc3..3fdd9d19a8 100644 --- a/lib/classes/caption/Field/Value.php +++ b/lib/classes/caption/Field/Value.php @@ -423,19 +423,17 @@ class caption_Field_Value implements cache_cacheableInterface } /** - * * @param string $word - * @return array + * @return string[] */ protected function splitTermAndContext($word) { $term = trim($word); - $context = ""; - if (($po = strpos($term, "(")) !== false) { - if (($pc = strpos($term, ")", $po)) !== false) { - $context = trim(substr($term, $po + 1, $pc - $po - 1)); - $term = trim(substr($term, 0, $po)); - } + $context = ''; + + if (($po = strpos($term, '(')) !== false && ($pc = strpos($term, ')', $po)) !== false) { + $context = trim(substr($term, $po + 1, $pc - $po - 1)); + $term = trim(substr($term, 0, $po)); } return [$term, $context]; diff --git a/lib/classes/unicode.php b/lib/classes/unicode.php index 4372f89fca..cb360240df 100644 --- a/lib/classes/unicode.php +++ b/lib/classes/unicode.php @@ -1541,17 +1541,7 @@ class unicode ] ]; - protected $endCharacters_utf8 = "\t\r\n !\"#\$%&'()+,-./:;<=>@[\]^_`{|}~£§¨°"; - - public function get_indexer_bad_chars() - { - return $this->endCharacters_utf8; - } - - public function has_indexer_bad_char($string) - { - return mb_strpos($this->endCharacters_utf8, $string); - } + protected $endCharacters_utf8 = "\t\r\n !\"#\$%&'()+,-./:;<=>@[\\]^_`{|}~£§¨°"; /** * Converts a string