summaryrefslogtreecommitdiff
path: root/providers
diff options
context:
space:
mode:
Diffstat (limited to 'providers')
-rw-r--r--providers/Provider.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/providers/Provider.php b/providers/Provider.php
index 2e14d2b..bf85f12 100644
--- a/providers/Provider.php
+++ b/providers/Provider.php
@@ -41,12 +41,29 @@ 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);
+ }
+ }
+ }
+ return $items;
+ }
+
public function get() {
$items = $this->_getItems();
if (isset($this->_options['spamfilter'])) {
$items = $this->_spamFilter($items);
}
- return $this->_sortContent($this->_mapItems($items));
+ return $this->_sortContent(
+ $this->_filterItemContent(
+ $this->_mapItems($items)
+ )
+ );
}
public function cacheTime() {