diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-04-24 20:14:42 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-04-24 20:14:42 +0200 |
commit | 29b9e27078ea2a1ca404a7b7b32de7e7afc52274 (patch) | |
tree | 92fc9aa990e600a1d769f1d7cc85d4372a302a2e | |
parent | fd47fbe17645b34448f38ac2819ac23ddbb405da (diff) | |
download | nextcloud-server-29b9e27078ea2a1ca404a7b7b32de7e7afc52274.tar.gz nextcloud-server-29b9e27078ea2a1ca404a7b7b32de7e7afc52274.zip |
fix linkto function in OC_Helper
-rwxr-xr-x | lib/helper.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/helper.php b/lib/helper.php index 072a544a40a..e532d5391f9 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -41,11 +41,15 @@ class OC_Helper { $app .= '/'; // Check if the app is in the app folder if( file_exists( OC::$APPSROOT . '/apps/'. $app.$file )){ - if(substr($app, -1, 1) == '/'){ - $app = substr($app, 0, strlen($app) - 1); + if(substr($file, -3) == 'php'){ + if(substr($app, -1, 1) == '/'){ + $app = substr($app, 0, strlen($app) - 1); + } + $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; + $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; + }else{ + $urlLinkTo = OC::$APPSWEBROOT . '/' . $app . $file; } - $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; - $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; } else{ $urlLinkTo = OC::$WEBROOT . '/' . $app . $file; |