rename var file to getfile to prevent fails in files app

This commit is contained in:
Georg Ehrke 2012-04-23 16:36:24 +02:00
parent aaedb23f05
commit 9226cb7a6a
3 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ OC={
var isCore=OC.coreApps.indexOf(app)!=-1;
var link=OC.webroot;
if(file.substring(file.length-3) == 'php' && !isCore){
link+='/?app=' + app + '&file=' + type + '/' + file;
link+='/?app=' + app + '&getfile=' + type + '/' + file;
}else{
link+='/';
app+='/';

View File

@ -399,16 +399,16 @@ class OC{
register_shutdown_function(array('OC_Helper','cleanTmp'));
self::$REQUESTEDAPP = (isset($_GET['app'])?strip_tags($_GET['app']):'files');
self::$REQUESTEDFILE = $_GET['file'];
self::$REQUESTEDFILE = $_GET['getfile'];
if(substr_count(self::$REQUESTEDFILE, '?') != 0){
$pos_questionmark = strpos(self::$REQUESTEDFILE, '?');
$pos_equal = strpos(self::$REQUESTEDFILE, '=');
$pos_and = strpos(self::$REQUESTEDFILE, '?');
$_GET[substr(self::$REQUESTEDFILE, $pos_questionmark + 1, $pos_equal - $pos_questionmark - 1)] = substr(self::$REQUESTEDFILE, $pos_equal + 1, $pos_and);
self::$REQUESTEDFILE = substr(self::$REQUESTEDFILE, 0, $pos_questionmark);
$_GET['file'] = OC::$REQUESTEDFILE;
$_GET['getfile'] = OC::$REQUESTEDFILE;
}
self::$REQUESTEDFILE = (isset($_GET['file'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null);
self::$REQUESTEDFILE = (isset($_GET['getfile'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null);
}
}

View File

@ -45,7 +45,7 @@ class OC_Helper {
$app = substr($app, 0, strlen($app) - 1);
}
$urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app;
$urlLinkTo .= ($file!='index.php')?'&file=' . $file:'';
$urlLinkTo .= ($file!='index.php')?'&getfile=' . $file:'';
}
else{
$urlLinkTo = OC::$WEBROOT . '/' . $app . $file;