Added pipework/linework comments to each page

This commit is contained in:
Frank Schubert
2022-05-03 17:09:14 +02:00
parent b5983b27f1
commit ed2dda4443
6 changed files with 48 additions and 19 deletions
+11 -11
View File
@@ -39,14 +39,14 @@ class mfUpload_TmpFile {
if(move_uploaded_file($this->tmp_name, $path)) {
return true;
} else {
$this->errormessage="Cannot move uploaded file to $path.";
$this->errormessage = "Cannot move uploaded file to $path.";
}
}
return false;
}
public function getFileSize() {
$stat=stat($this->tmp_name);
$stat = stat($this->tmp_name);
if(is_array($stat) && count($stat)) {
return $stat[7];
}
@@ -54,33 +54,33 @@ class mfUpload_TmpFile {
}
public function getFilename() {
$filename=$this->filename;
$filename = $this->filename;
// assume filename contains whole path on users machine and cut it.
if(preg_match('#([^/\\\]+$)#',$filename,$match)) {
$filename=$match[1];
$filename = $match[1];
} else {
$this->errormessage="No file selected.";
$this->errormessage = "No file selected.";
return false; // if there is no filename
}
// remove potentially dangerous characters
while(strstr($filename,'..')) {
$filename=str_replace('..',".",$filename);
$filename = str_replace('..',".",$filename);
}
if(!strlen($filename)) {
$this->errormessage="No file selected.";
$this->errormessage = "No file selected.";
return false;
}
$filename=preg_replace('/[^a-z0-9$()+%äöüß._-]/i', '_', $filename);
$filename = preg_replace('/[^a-z0-9$()+%äöüß._-]/i', '_', $filename);
$parts=explode(".",$filename);
$ext=strtolower(array_pop($parts));
$parts = explode(".",$filename);
$ext = strtolower(array_pop($parts));
if(!preg_match('/^'.MFUPLOAD_ALLOWED_EXTENSIONS.'$/i',$ext)) {
$this->errormessage="File type not allowed. Supported file types are ".ALLOWED_EXTENSIONS_STR;
$this->errormessage = "File type not allowed. Supported file types are ".ALLOWED_EXTENSIONS_STR;
return false;
}