From f22b4b33df7369c13c796d7b940cdac3adcb35fb Mon Sep 17 00:00:00 2001 From: Paul de Rosanbo Date: Thu, 21 Jan 2016 14:05:14 +0100 Subject: [PATCH 1/2] Fix notice about undefined variable --- formats/AtomFormat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formats/AtomFormat.php b/formats/AtomFormat.php index 536c16a..74e78db 100644 --- a/formats/AtomFormat.php +++ b/formats/AtomFormat.php @@ -37,7 +37,7 @@ class AtomFormat extends FormatAbstract{ $entryContent = is_null($data->content) ? '' : 'sanitizeHtml(str_replace(']]>','',$data->content)) . ']]>'; // We generate a list of the enclosure links - $entryEnclosure = ""; + $entryEnclosures = ""; foreach($data->enclosures as $enclosure) { From e59bf64c42ea199c73fad35f24f2e189c22ee5f8 Mon Sep 17 00:00:00 2001 From: Paul de Rosanbo Date: Thu, 21 Jan 2016 14:06:48 +0100 Subject: [PATCH 2/2] Fix cache bug, the content of the cache was encoded in utf8 before converting to json and saved, resulting in double-encoded caracters in output --- caches/FileCache.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/caches/FileCache.php b/caches/FileCache.php index f2a3ea8..c348fdf 100644 --- a/caches/FileCache.php +++ b/caches/FileCache.php @@ -8,7 +8,7 @@ class FileCache extends CacheAbstract{ public function loadData(){ $this->isPrepareCache(); - $datas = json_decode(file_get_contents($this->getCacheFile()),true); + $datas = unserialize(file_get_contents($this->getCacheFile())); $items = array(); foreach($datas as $aData){ $item = new \Item(); @@ -25,9 +25,9 @@ class FileCache extends CacheAbstract{ $this->isPrepareCache(); //Re-encode datas to UTF-8 - $datas = Cache::utf8_encode_deep($datas); + //$datas = Cache::utf8_encode_deep($datas); - $writeStream = file_put_contents($this->getCacheFile(), json_encode($datas)); + $writeStream = file_put_contents($this->getCacheFile(), serialize($datas)); if(!$writeStream) {