diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-28 21:26:03 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-28 22:11:04 +0200 |
commit | 19bb4e83c994a31578d35d8a43a6ab4b180858d7 (patch) | |
tree | 2688afb0b6df17bf2abba70a5bced79c1486c15c /lib | |
parent | b2cbf1199ddf9802316a4508ee312490c6b88ddb (diff) | |
download | nextcloud-server-19bb4e83c994a31578d35d8a43a6ab4b180858d7.tar.gz nextcloud-server-19bb4e83c994a31578d35d8a43a6ab4b180858d7.zip |
Remove redundant code from OC_Helper::linkTo
Diffstat (limited to 'lib')
-rw-r--r-- | lib/helper.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/helper.php b/lib/helper.php index 6ab55f27618..64378da356e 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -38,13 +38,10 @@ class OC_Helper { */ public static function linkTo( $app, $file ){ if( $app != '' ){ - $app .= '/'; + $app_path = OC_App::getAppPath($app); // Check if the app is in the app folder - if( file_exists( OC_App::getAppPath($app).'/'.$file )){ + if( $app_path && file_exists( $app_path.'/'.$file )){ if(substr($file, -3) == 'php' || substr($file, -3) == 'css'){ - if(substr($app, -1, 1) == '/'){ - $app = substr($app, 0, strlen($app) - 1); - } $urlLinkTo = OC::$WEBROOT . '/?app=' . $app; $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; }else{ @@ -52,7 +49,7 @@ class OC_Helper { } } else{ - $urlLinkTo = OC::$WEBROOT . '/' . $app . $file; + $urlLinkTo = OC::$WEBROOT . '/' . $app . '/' . $file; } } else{ |