diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2011-04-16 12:43:37 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2011-04-16 12:43:37 +0200 |
commit | 627dc95d1949861dd1fe4dfa8bb8ff6ddaa9df5b (patch) | |
tree | 0211ea7c092d594feaeeac27179209599c7db546 /lib/helper.php | |
parent | 8465f76e7e1aa5512d62905cc60a10f0fe3f0e02 (diff) | |
download | nextcloud-server-627dc95d1949861dd1fe4dfa8bb8ff6ddaa9df5b.tar.gz nextcloud-server-627dc95d1949861dd1fe4dfa8bb8ff6ddaa9df5b.zip |
don't manifold slashes in case empty $app is forwarded to linkTo()
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/helper.php b/lib/helper.php index c51629f21cb..4fff7c28fea 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -36,12 +36,16 @@ class OC_HELPER { public static function linkTo( $app, $file ){ global $WEBROOT; global $SERVERROOT; - + + if(!empty($app)) { + $app .= '/'; + } + // Check if the app is in the app folder - if( file_exists( "$SERVERROOT/apps/$app/$file" )){ - return "$WEBROOT/apps/$app/$file"; + if( file_exists( $SERVERROOT . '/apps/'. $app . $file )){ + return $WEBROOT . '/apps/' . $app . $file; } - return "$WEBROOT/$app/$file"; + return $WEBROOT . '/' . $app . $file; } /** |