From b7538b6ada4df7ace6f27bc6349b63ca7f8651e8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 21 Oct 2015 15:00:41 -0700 Subject: turn relative links in app_render() into absolute links, without affecting the install. --- include/apps.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/apps.php b/include/apps.php index c036867b1..0a62dc5a8 100644 --- a/include/apps.php +++ b/include/apps.php @@ -176,14 +176,19 @@ function app_render($papp,$mode = 'view') { $installed = false; - if(! $papp['photo']) - $papp['photo'] = z_root() . '/' . get_default_profile_photo(80); - if(! $papp) return; + if(! $papp['photo']) + $papp['photo'] = z_root() . '/' . get_default_profile_photo(80); + + + $papp['papp'] = papp_encode($papp); + if(! strstr($papp['url'],'://')) + $papp['url'] = z_root() . ((strpos($papp['url'],'/') === 0) ? '' : '/') . $papp['url']; + foreach($papp as $k => $v) { if(strpos($v,'http') === 0 && $k != 'papp') $papp[$k] = zid($v); -- cgit v1.2.3