diff --git a/lib/helper.php b/lib/helper.php index c51629f21c..4fff7c28fe 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; - - // Check if the app is in the app folder - if( file_exists( "$SERVERROOT/apps/$app/$file" )){ - return "$WEBROOT/apps/$app/$file"; + + if(!empty($app)) { + $app .= '/'; } - return "$WEBROOT/$app/$file"; + + // Check if the app is in the app folder + if( file_exists( $SERVERROOT . '/apps/'. $app . $file )){ + return $WEBROOT . '/apps/' . $app . $file; + } + return $WEBROOT . '/' . $app . $file; } /**