From aa18d7bb62b75df17153f831f67dfcdbe03552f1 Mon Sep 17 00:00:00 2001 From: PeaceCopathe Date: Mon, 15 Apr 2013 23:51:48 +0200 Subject: [PATCH] Compression sur le content et correction bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rajout de gzinflate() et base64_encode() sur le "content". - Correction bug si tentative de suppression répertoire archiveImg non existant --- inc/functions.php | 5 ++++- view.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 7c475749a..056339b0d 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -112,7 +112,7 @@ function prepare_url($url,$id) { $content = $r->articleContent->innerHTML; $parametres['title'] = $r->articleTitle->innerHTML; - $parametres['content']=filtre_img($content, $url, $id); + $parametres['content']=base64_encode(gzdeflate(filtre_img($content, $url, $id))); return $parametres; } } @@ -205,11 +205,14 @@ function makeArchiveRep($rep) //supprime le répertoire si on supprime le lien. function delArchiveRep($rep) { + if(is_dir($rep)) + { $files = array_diff(scandir($rep), array('.','..')); foreach ($files as $file) { (is_dir("$rep/$file")) ? delTree("$rep/$file") : unlink("$rep/$file"); } return rmdir($rep); + } } /** diff --git a/view.php b/view.php index dfc26b9d5..f0ae63d42 100755 --- a/view.php +++ b/view.php @@ -20,7 +20,7 @@ if(!empty($id)) { $tpl->assign('id', $entry[0]['id']); $tpl->assign('url', $entry[0]['url']); $tpl->assign('title', $entry[0]['title']); - $tpl->assign('content', $entry[0]['content']); + $tpl->assign('content', gzinflate(base64_decode($entry[0]['content']))); $tpl->assign('is_fav', $entry[0]['is_fav']); $tpl->assign('is_read', $entry[0]['is_read']); $tpl->assign('load_all_js', 0);