Skip to content
Snippets Groups Projects
Commit 19bb4e83 authored by Bart Visscher's avatar Bart Visscher
Browse files

Remove redundant code from OC_Helper::linkTo

parent b2cbf119
No related branches found
No related tags found
No related merge requests found
......@@ -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{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment