summaryrefslogtreecommitdiff
path: root/providers
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2025-04-07 15:48:44 +0200
committeremkael <emkael@tlen.pl>2025-04-07 15:48:44 +0200
commit063a161bf7ca2bb3f5eb6a6c75d08058d158c316 (patch)
treeb7c56b6a01225add4998a02da3a91e212322a300 /providers
parent57f61fd6a62c7051e98fb040ca0b08f958710898 (diff)
Enable no-emoji mode by default + update emoji list URLs
Diffstat (limited to 'providers')
-rw-r--r--providers/Provider.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/providers/Provider.php b/providers/Provider.php
index fe2195c..baec215 100644
--- a/providers/Provider.php
+++ b/providers/Provider.php
@@ -44,22 +44,27 @@ abstract class Provider {
}
}
- protected function _filterItemContent($items) {
- if (in_array('noemoji', $this->_options)) {
- $dictionary = json_decode(file_get_contents('../config/emoji.json'), TRUE);
- $filtered = [];
- foreach ($items as $item) {
- foreach (['Title', 'Text'] as $field) {
- $item->{$field} = strtr($item->{$field}, $dictionary);
- }
+ private function _filterEmoji($items) {
+ $dictionary = json_decode(file_get_contents('../config/emoji.json'), TRUE);
+ $filtered = [];
+ foreach ($items as $item) {
+ foreach (['Title', 'Text'] as $field) {
+ $item->{$field} = strtr($item->{$field}, $dictionary);
}
}
+ return $items;
+ }
+
+ protected function _filterItemContent($items) {
+ $items = $this->_filterEmoji($items);
+
if (array_key_exists('title', $this->_options)) {
$keyword = strtolower($this->_options['title']);
$items = array_filter($items, function($item) use($keyword) {
return str_contains(strtolower($item->Title), $keyword);
});
}
+
return $items;
}