]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix linkto function in OC_Helper
authorGeorg Ehrke <dev@georgswebsite.de>
Tue, 24 Apr 2012 18:14:42 +0000 (20:14 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Tue, 24 Apr 2012 18:14:42 +0000 (20:14 +0200)
lib/helper.php

index 072a544a40a3ba3f326dce6fc058111dd12ec4f8..e532d5391f97e324b15b37ac474d8e6d211fecbe 100755 (executable)
@@ -41,11 +41,15 @@ class OC_Helper {
                        $app .= '/';
                        // Check if the app is in the app folder
                        if( file_exists( OC::$APPSROOT . '/apps/'. $app.$file )){
-                               if(substr($app, -1, 1) == '/'){
-                                       $app = substr($app, 0, strlen($app) - 1);
+                               if(substr($file, -3) == 'php'){ 
+                                       if(substr($app, -1, 1) == '/'){
+                                               $app = substr($app, 0, strlen($app) - 1);
+                                       }
+                                       $urlLinkTo =  OC::$APPSWEBROOT . '/?app=' . $app;
+                                       $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):'';
+                               }else{
+                                       $urlLinkTo =  OC::$APPSWEBROOT . '/' . $app . $file;
                                }
-                               $urlLinkTo =  OC::$APPSWEBROOT . '/?app=' . $app;
-                               $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):'';
                        }
                        else{
                                $urlLinkTo =  OC::$WEBROOT . '/' . $app . $file;