From ea67b9bda895d30d3115b04ba78db35e6a8b0a74 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 18 May 2014 20:00:30 -0700 Subject: [PATCH] apps: fix encoding/decoding and chunk splitting --- include/apps.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apps.php b/include/apps.php index ac6f34ee5..109da2454 100644 --- a/include/apps.php +++ b/include/apps.php @@ -153,7 +153,7 @@ function app_list($uid) { function app_decode($s) { - $x = base64_decode($s); + $x = base64_decode(str_replace(array('
',"\r","\n",' '),array('','','',''),$s)); return json_decode($x,true); } @@ -249,6 +249,6 @@ function app_encode($app) { $ret['page'] = $app['app_page']; $j = json_encode($ret); - return '[app]' . base64_encode($j) . '[/app]'; + return '[app]' . chunk_split(base64_encode($j),72,"\n") . '[/app]'; } \ No newline at end of file