Project

General

Profile

Bug #15469 ยป class.tx_tstemplateinfo.php.patch

Administrator Admin, 2006-01-20 20:51

View differences:

O:\typo3\ext\tstemplate_info\class.tx_tstemplateinfo.php Fri Jan 20 20:17:45 2006
$path = PATH_site.$TCA["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$edit["filename"];
$fI=t3lib_div::split_fileref($edit["filename"]);
if (@is_file($path) && t3lib_div::getFileAbsFileName($path) && t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"])) { // checks that have already been done.. Just to make sure
if (filesize($path)<(30*1024)) { // checks that have already been done.. Just to make sure
if (filesize($path)<($TCA["sys_template"]["columns"]["resources"]["config"]["max_size"]*1024)) { // checks that have already been done.. Just to make sure
t3lib_div::writeFile($path,$edit['file']);
$theOutput.=$this->pObj->doc->spacer(10);
......
// debug($path);
$fI=t3lib_div::split_fileref($e[file]);
if (@is_file($path) && t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"])) {
if (filesize($path)<(30*1024)) {
if (filesize($path)<($TCA["sys_template"]["columns"]["resources"]["config"]["max_size"]*1024)) {
$fileContent = t3lib_div::getUrl($path);
$outCode='File: <b>'.$e[file].'</b><BR>';
$outCode.='<textarea name="edit[file]" rows="'.$numberOfRows.'" wrap="off"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").'>'.t3lib_div::formatForTextarea($fileContent).'</textarea>';
......
$theOutput.=$this->pObj->doc->sectionEnd().$outCode;
} else {
$theOutput.=$this->pObj->doc->spacer(15);
$theOutput.=$this->pObj->doc->section('<font color=red>Filesize exceeded 30 Kbytes</font>','Files larger than 30 KByes are not allowed to be edited.',0,0,0,1);
$theOutput.=$this->pObj->doc->section('<font color=red>Filesize exceeded '.$TCA["sys_template"]["columns"]["resources"]["config"]["max_size"].' Kbytes</font>','Files larger than '.$TCA["sys_template"]["columns"]["resources"]["config"]["max_size"].' KByes are not allowed to be edited.',0,0,0,1);
}
}
}
    (1-1/1)