Merged in jennydmz/processmaker/BUG-14990 (pull request #1073)

PM-794 No se permiten extensiones con numeros en Inputdocs
This commit is contained in:
Julio Cesar Laura Avendaño
2014-10-27 13:04:55 -04:00
4 changed files with 9 additions and 9 deletions

View File

@@ -5375,11 +5375,11 @@ class G
$res = new stdclass();
if (!extension_loaded('fileinfo')) {
$dtype = explode(".", $filesName);
$dtype = explode(".", strtolower($filesName));
foreach ($allowedTypes as $types => $val) {
if ((preg_match('/^\*\.?[a-z]{2,8}$/', $val)) || ($val == '*.*')) {
$allowedDocTypes = substr($val, 2);
if ((preg_match('/^\*\.?[a-zA-Z0-9]{2,15}$/', $val)) || ($val == '*.*')) {
$allowedDocTypes = strtolower(substr($val, 2));
if (($dtype[count($dtype) -1]) == $allowedDocTypes || $allowedDocTypes == '*') {
$res->status = true;
return $res;
@@ -5399,9 +5399,9 @@ class G
$docType = explode("/", $finfo_);
foreach ($allowedTypes as $types => $val) {
if ((preg_match('/^\*\.?[a-z]{2,8}$/', $val)) || ($val == '*.*')) {
$allowedDocTypes = substr($val, 2);
$dtype = explode(".", $filesName);
if ((preg_match('/^\*\.?[a-zA-Z0-9]{2,15}$/', $val)) || ($val == '*.*')) {
$allowedDocTypes = strtolower(substr($val, 2));
$dtype = explode(".", strtolower($filesName));
switch($allowedDocTypes){
case '*':

View File

@@ -92,7 +92,7 @@ try {
//Allowed Types has to have this format -> *.pdf, *.docx or *.* to all.
$allowedTypes = explode(", ", $aData['INP_DOC_TYPE_FILE']);
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 {
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_WRONG_ALLOWED_EXTENSION_FORMAT' );
G::SendMessageText( $message, "ERROR" );

View File

@@ -67,7 +67,7 @@ var verifyInfo = function(oForm)
for(i=0; i<allowedTypes.length; i++){
allowed = allowedTypes[i].replace('*','').replace('.','');
if((allowed != '*') && (docType != allowed)){
if((allowed != '*') && (docType.toLowerCase() != allowed.toLowerCase())){
flag = 1;
} else {
flag = 0;

View File

@@ -31,7 +31,7 @@ var currentPagedTable = @#PAGED_TABLE_ID;
}
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++){
atype = allowedTypes[i];