Merged in jennydmz/processmaker/BUG-14990 (pull request #1073)
PM-794 No se permiten extensiones con numeros en Inputdocs
This commit is contained in:
@@ -5375,11 +5375,11 @@ class G
|
|||||||
$res = new stdclass();
|
$res = new stdclass();
|
||||||
|
|
||||||
if (!extension_loaded('fileinfo')) {
|
if (!extension_loaded('fileinfo')) {
|
||||||
$dtype = explode(".", $filesName);
|
$dtype = explode(".", strtolower($filesName));
|
||||||
|
|
||||||
foreach ($allowedTypes as $types => $val) {
|
foreach ($allowedTypes as $types => $val) {
|
||||||
if ((preg_match('/^\*\.?[a-z]{2,8}$/', $val)) || ($val == '*.*')) {
|
if ((preg_match('/^\*\.?[a-zA-Z0-9]{2,15}$/', $val)) || ($val == '*.*')) {
|
||||||
$allowedDocTypes = substr($val, 2);
|
$allowedDocTypes = strtolower(substr($val, 2));
|
||||||
if (($dtype[count($dtype) -1]) == $allowedDocTypes || $allowedDocTypes == '*') {
|
if (($dtype[count($dtype) -1]) == $allowedDocTypes || $allowedDocTypes == '*') {
|
||||||
$res->status = true;
|
$res->status = true;
|
||||||
return $res;
|
return $res;
|
||||||
@@ -5399,9 +5399,9 @@ class G
|
|||||||
$docType = explode("/", $finfo_);
|
$docType = explode("/", $finfo_);
|
||||||
|
|
||||||
foreach ($allowedTypes as $types => $val) {
|
foreach ($allowedTypes as $types => $val) {
|
||||||
if ((preg_match('/^\*\.?[a-z]{2,8}$/', $val)) || ($val == '*.*')) {
|
if ((preg_match('/^\*\.?[a-zA-Z0-9]{2,15}$/', $val)) || ($val == '*.*')) {
|
||||||
$allowedDocTypes = substr($val, 2);
|
$allowedDocTypes = strtolower(substr($val, 2));
|
||||||
$dtype = explode(".", $filesName);
|
$dtype = explode(".", strtolower($filesName));
|
||||||
|
|
||||||
switch($allowedDocTypes){
|
switch($allowedDocTypes){
|
||||||
case '*':
|
case '*':
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ try {
|
|||||||
//Allowed Types has to have this format -> *.pdf, *.docx or *.* to all.
|
//Allowed Types has to have this format -> *.pdf, *.docx or *.* to all.
|
||||||
$allowedTypes = explode(", ", $aData['INP_DOC_TYPE_FILE']);
|
$allowedTypes = explode(", ", $aData['INP_DOC_TYPE_FILE']);
|
||||||
foreach ($allowedTypes as $types => $val) {
|
foreach ($allowedTypes as $types => $val) {
|
||||||
if((preg_match('/^\*\.?[a-z]{2,8}$/', $val)) || ($val == '*.*')){
|
if((preg_match('/^\*\.?[a-zA-Z0-9]{2,15}$/', $val)) || ($val == '*.*')){
|
||||||
}else {
|
}else {
|
||||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_WRONG_ALLOWED_EXTENSION_FORMAT' );
|
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_WRONG_ALLOWED_EXTENSION_FORMAT' );
|
||||||
G::SendMessageText( $message, "ERROR" );
|
G::SendMessageText( $message, "ERROR" );
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ var verifyInfo = function(oForm)
|
|||||||
|
|
||||||
for(i=0; i<allowedTypes.length; i++){
|
for(i=0; i<allowedTypes.length; i++){
|
||||||
allowed = allowedTypes[i].replace('*','').replace('.','');
|
allowed = allowedTypes[i].replace('*','').replace('.','');
|
||||||
if((allowed != '*') && (docType != allowed)){
|
if((allowed != '*') && (docType.toLowerCase() != allowed.toLowerCase())){
|
||||||
flag = 1;
|
flag = 1;
|
||||||
} else {
|
} else {
|
||||||
flag = 0;
|
flag = 0;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var currentPagedTable = @#PAGED_TABLE_ID;
|
|||||||
}
|
}
|
||||||
|
|
||||||
allowedTypes = getField('INP_DOC_TYPE_FILE').value.split(", ");
|
allowedTypes = getField('INP_DOC_TYPE_FILE').value.split(", ");
|
||||||
expreg = /^\*\.?[a-z]{2,8}$/;
|
expreg = /^\*\.?[a-zA-Z0-9]{2,15}$/;
|
||||||
|
|
||||||
for(i=0; i<allowedTypes.length; i++){
|
for(i=0; i<allowedTypes.length; i++){
|
||||||
atype = allowedTypes[i];
|
atype = allowedTypes[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user