From 0fac66d720e3a979de4f6d97d5e0282e6e4bd449 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 6 Aug 2025 23:47:21 +0200 Subject: [PATCH 1/2] Remove com_search code from Language class --- libraries/src/Language/Language.php | 244 ---------------------------- 1 file changed, 244 deletions(-) diff --git a/libraries/src/Language/Language.php b/libraries/src/Language/Language.php index 7c2089f7a5867..4eb2213dc8b36 100644 --- a/libraries/src/Language/Language.php +++ b/libraries/src/Language/Language.php @@ -56,46 +56,6 @@ class Language extends BaseLanguage */ protected $pluralSuffixesCallback = null; - /** - * Name of the ignoredSearchWordsCallback function for this language. - * - * @var callable - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - protected $ignoredSearchWordsCallback = null; - - /** - * Name of the lowerLimitSearchWordCallback function for this language. - * - * @var callable - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - protected $lowerLimitSearchWordCallback = null; - - /** - * Name of the upperLimitSearchWordCallback function for this language. - * - * @var callable - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - protected $upperLimitSearchWordCallback = null; - - /** - * Name of the searchDisplayedCharactersNumberCallback function for this language. - * - * @var callable - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - protected $searchDisplayedCharactersNumberCallback = null; - /** * Constructor activating the default information of the language. * @@ -399,210 +359,6 @@ public function setPluralSuffixesCallback(callable $function) return $previous; } - /** - * Returns an array of ignored search words - * - * @return array The array of ignored search words. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getIgnoredSearchWords() - { - if ($this->ignoredSearchWordsCallback !== null) { - return \call_user_func($this->ignoredSearchWordsCallback); - } - - return []; - } - - /** - * Getter for ignoredSearchWordsCallback function. - * - * @return callable Function name or the actual function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getIgnoredSearchWordsCallback() - { - return $this->ignoredSearchWordsCallback; - } - - /** - * Setter for the ignoredSearchWordsCallback function - * - * @param callable $function Function name or actual function. - * - * @return callable The previous function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function setIgnoredSearchWordsCallback(callable $function) - { - $previous = $this->ignoredSearchWordsCallback; - $this->ignoredSearchWordsCallback = $function; - - return $previous; - } - - /** - * Returns a lower limit integer for length of search words - * - * @return integer The lower limit integer for length of search words (3 if no value was set for a specific language). - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getLowerLimitSearchWord() - { - if ($this->lowerLimitSearchWordCallback !== null) { - return \call_user_func($this->lowerLimitSearchWordCallback); - } - - return 3; - } - - /** - * Getter for lowerLimitSearchWordCallback function - * - * @return callable Function name or the actual function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getLowerLimitSearchWordCallback() - { - return $this->lowerLimitSearchWordCallback; - } - - /** - * Setter for the lowerLimitSearchWordCallback function. - * - * @param callable $function Function name or actual function. - * - * @return callable The previous function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function setLowerLimitSearchWordCallback(callable $function) - { - $previous = $this->lowerLimitSearchWordCallback; - $this->lowerLimitSearchWordCallback = $function; - - return $previous; - } - - /** - * Returns an upper limit integer for length of search words - * - * @return integer The upper limit integer for length of search words (200 if no value was set or if default value is < 200). - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getUpperLimitSearchWord() - { - if ($this->upperLimitSearchWordCallback !== null && \call_user_func($this->upperLimitSearchWordCallback) > 200) { - return \call_user_func($this->upperLimitSearchWordCallback); - } - - return 200; - } - - /** - * Getter for upperLimitSearchWordCallback function - * - * @return callable Function name or the actual function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getUpperLimitSearchWordCallback() - { - return $this->upperLimitSearchWordCallback; - } - - /** - * Setter for the upperLimitSearchWordCallback function - * - * @param callable $function Function name or the actual function. - * - * @return callable The previous function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function setUpperLimitSearchWordCallback(callable $function) - { - $previous = $this->upperLimitSearchWordCallback; - $this->upperLimitSearchWordCallback = $function; - - return $previous; - } - - /** - * Returns the number of characters displayed in search results. - * - * @return integer The number of characters displayed (200 if no value was set for a specific language). - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getSearchDisplayedCharactersNumber() - { - if ($this->searchDisplayedCharactersNumberCallback !== null) { - return \call_user_func($this->searchDisplayedCharactersNumberCallback); - } - - return 200; - } - - /** - * Getter for searchDisplayedCharactersNumberCallback function - * - * @return callable Function name or the actual function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function getSearchDisplayedCharactersNumberCallback() - { - return $this->searchDisplayedCharactersNumberCallback; - } - - /** - * Setter for the searchDisplayedCharactersNumberCallback function. - * - * @param callable $function Function name or the actual function. - * - * @return callable The previous function. - * - * @since 1.7.0 - * - * @deprecated 4.4 will be removed in 6.0 without replacement - */ - public function setSearchDisplayedCharactersNumberCallback(callable $function) - { - $previous = $this->searchDisplayedCharactersNumberCallback; - $this->searchDisplayedCharactersNumberCallback = $function; - - return $previous; - } - /** * Loads a single language file and appends the results to the existing strings * From 2b7d801e3be3cbb0300869631abd347da52db433 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 7 Aug 2025 00:07:44 +0200 Subject: [PATCH 2/2] Additional code removal --- libraries/src/Language/Language.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/libraries/src/Language/Language.php b/libraries/src/Language/Language.php index 4eb2213dc8b36..0c3155075b73d 100644 --- a/libraries/src/Language/Language.php +++ b/libraries/src/Language/Language.php @@ -133,22 +133,6 @@ public function __construct($lang = null, $debug = false) if (method_exists($class, 'getPluralSuffixes')) { $this->pluralSuffixesCallback = [$class, 'getPluralSuffixes']; } - - if (method_exists($class, 'getIgnoredSearchWords')) { - $this->ignoredSearchWordsCallback = [$class, 'getIgnoredSearchWords']; - } - - if (method_exists($class, 'getLowerLimitSearchWord')) { - $this->lowerLimitSearchWordCallback = [$class, 'getLowerLimitSearchWord']; - } - - if (method_exists($class, 'getUpperLimitSearchWord')) { - $this->upperLimitSearchWordCallback = [$class, 'getUpperLimitSearchWord']; - } - - if (method_exists($class, 'getSearchDisplayedCharactersNumber')) { - $this->searchDisplayedCharactersNumberCallback = [$class, 'getSearchDisplayedCharactersNumber']; - } } $this->load();