From: Arthur Schiwon Date: Sat, 16 Apr 2011 10:43:37 +0000 (+0200) Subject: don't manifold slashes in case empty $app is forwarded to linkTo() X-Git-Tag: v3.0~267^2~558^2~143^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=627dc95d1949861dd1fe4dfa8bb8ff6ddaa9df5b;p=nextcloud-server.git don't manifold slashes in case empty $app is forwarded to linkTo() --- 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; } /**