This commit is contained in:
Roly Rudy Gutierrez Pinto
2018-08-28 09:34:11 -04:00
committed by Paula Quispe
parent 88b61567e2
commit d263c5a7ca
27 changed files with 658 additions and 97 deletions

View File

@@ -4,6 +4,7 @@ use ProcessMaker\Core\System;
use ProcessMaker\AuditLog\AuditLog;
use ProcessMaker\Plugins\PluginRegistry;
use ProcessMaker\Services\OAuth2\Server;
use ProcessMaker\Validation\ValidationUploadedFiles;
class G
{
@@ -1183,7 +1184,7 @@ class G
\Bootstrap::registerMonologPhpUploadExecution('phpExecution', 200, 'Php Execution', $filename);
require_once($filename);
} else {
$message = G::LoadTranslation('THE_PHP_FILES_EXECUTION_WAS_DISABLED');
$message = G::LoadTranslation('ID_THE_PHP_FILES_EXECUTION_WAS_DISABLED');
\Bootstrap::registerMonologPhpUploadExecution('phpExecution', 550, $message, $filename);
echo $message;
}
@@ -5488,6 +5489,16 @@ class G
*/
public static function verifyInputDocExtension($InpDocAllowedFiles, $fileName, $filesTmpName)
{
$error = null;
ValidationUploadedFiles::getValidationUploadedFiles()->dispach(function($validator) use(&$error) {
$error = new stdclass();
$error->status = false;
$error->message = $validator->getMessage();
});
if (!is_null($error)) {
return $error;
}
// Initialize variables
$res = new stdclass();
$res->status = false;
@@ -5497,14 +5508,6 @@ class G
$aux = pathinfo($fileName);
$fileExtension = isset($aux['extension']) ? strtolower($aux['extension']) : '';
if (\Bootstrap::getDisablePhpUploadExecution() === 1 && $fileExtension === 'php') {
$message = \G::LoadTranslation('THE_UPLOAD_OF_PHP_FILES_WAS_DISABLED');
\Bootstrap::registerMonologPhpUploadExecution('phpUpload', 550, $message, $fileName);
$res->status = false;
$res->message = $message;
return $res;
}
// If required extension is *.* don't validate
if (in_array('*', $allowedTypes)) {
$res->status = true;