summaryrefslogtreecommitdiffstats
path: root/db/item.php
diff options
context:
space:
mode:
Diffstat (limited to 'db/item.php')
-rw-r--r--db/item.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/item.php b/db/item.php
index 8f516f9c6..6b5a49f15 100644
--- a/db/item.php
+++ b/db/item.php
@@ -152,6 +152,20 @@ class Item extends Entity implements IAPI {
}
+ public function fromRow(array $array) {
+ // sanitize them fucked up non utf-8 strings because PHP's glorious idea
+ // on how to handle non utf-8 srtings in json_encode is to just *BOOM*
+ // in your face, which results in a spinning wheel. Forever.
+ foreach($array as $key => $value) {
+ if($key === 'body' || $key === 'author' || $key === 'title' ||
+ $key === 'guid' || $key === 'guidHash') {
+ $array[$key] === iconv('UTF-8', 'UTF-8//IGNORE', $value);
+ }
+ }
+ parent::fromRow($array);
+ }
+
+
public function setAuthor($name) {
parent::setAuthor(strip_tags($name));
}