]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix linkTo()
authorJakob Sack <kde@jakobsack.de>
Mon, 20 Jun 2011 19:01:34 +0000 (21:01 +0200)
committerJakob Sack <kde@jakobsack.de>
Mon, 20 Jun 2011 19:01:34 +0000 (21:01 +0200)
lib/helper.php

index 6f7d7ce251e25a9c74d3de64296c9e630e8cbe26..8cd6ebf75a54e8a7ea117160a97888f65e9d8fef 100644 (file)
@@ -37,17 +37,24 @@ class OC_HELPER {
                global $WEBROOT;
                global $SERVERROOT;
                
-               if(!empty($app)) {
+               if( $app != '' ){
                        $app .= '/';
                        // Check if the app is in the app folder
-                       if( file_exists( $SERVERROOT . '/apps/'. $app )){
+                       if( file_exists( $SERVERROOT . '/apps/'. $app.$file )){
                                return $WEBROOT . '/apps/' . $app . $file;
                        }
+                       else{
+                               return $WEBROOT . '/' . $app . $file;
+                       }
                }
                else{
-                       $app = 'core';
+                       if( file_exists( $SERVERROOT . '/core/'. $file )){
+                               return $WEBROOT . '/core/'.$file;
+                       }
+                       else{
+                               return $WEBROOT . '/'.$file;
+                       }
                }
-               return $WEBROOT . '/' . $app . $file;
        }
 
        /**