]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't manifold slashes in case empty $app is forwarded to linkTo()
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Sat, 16 Apr 2011 10:43:37 +0000 (12:43 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Sat, 16 Apr 2011 10:43:37 +0000 (12:43 +0200)
lib/helper.php

index c51629f21cbb1374c2b8e61a3ec2083438aa9151..4fff7c28fead34d4ce3be064bf2c0ebabdb8c0cd 100644 (file)
@@ -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;
        }
 
        /**