Commit ea53c7bfa45d6e2422945b8a2fad4cdad54d776e
1 parent
f07d6ebe
Exists in
master
and in
7 other branches
Alteração da expressão regular que valida os nomes dos arquivos acrescentando o caractere "_"
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
ferramentas/upload/upload.php
@@ -43,11 +43,11 @@ if (isset($_FILES['fileshp']['name'])) | @@ -43,11 +43,11 @@ if (isset($_FILES['fileshp']['name'])) | ||
43 | $dirmap = dirname($map_file); | 43 | $dirmap = dirname($map_file); |
44 | //verifica nomes | 44 | //verifica nomes |
45 | $statusNome = 1; | 45 | $statusNome = 1; |
46 | - if( (ereg('[^a-zA-Z0-9\.]',$_FILES['fileshp']['name'])) || (!ereg('\.shp$',$_FILES['fileshp']['name'])) ) | 46 | + if( (ereg('[^a-zA-Z0-9_\.]',$_FILES['fileshp']['name'])) || (!ereg('\.shp$',$_FILES['fileshp']['name'])) ) |
47 | {$statusNome = 0;} | 47 | {$statusNome = 0;} |
48 | - if( (ereg('[^a-zA-Z0-9\.]',$_FILES['fileshx']['name'])) || (!ereg('\.shx$',$_FILES['fileshx']['name'])) ) | 48 | + if( (ereg('[^a-zA-Z0-9_\.]',$_FILES['fileshx']['name'])) || (!ereg('\.shx$',$_FILES['fileshx']['name'])) ) |
49 | {$statusNome = 0;} | 49 | {$statusNome = 0;} |
50 | - if( (ereg('[^a-zA-Z0-9\.]',$_FILES['filedbf']['name'])) || (!ereg('\.dbf$',$_FILES['filedbf']['name'])) ) | 50 | + if( (ereg('[^a-zA-Z0-9_\.]',$_FILES['filedbf']['name'])) || (!ereg('\.dbf$',$_FILES['filedbf']['name'])) ) |
51 | {$statusNome = 0;} | 51 | {$statusNome = 0;} |
52 | if($statusNome != 1) | 52 | if($statusNome != 1) |
53 | {echo "Arquivos inválidos";exit;} | 53 | {echo "Arquivos inválidos";exit;} |
ferramentas/uploaddbf/upload.php
@@ -43,7 +43,7 @@ if (isset($_FILES['filedbf']['name'])) | @@ -43,7 +43,7 @@ if (isset($_FILES['filedbf']['name'])) | ||
43 | $dirmap = dirname($map_file); | 43 | $dirmap = dirname($map_file); |
44 | //verifica nomes | 44 | //verifica nomes |
45 | $statusNome = 1; | 45 | $statusNome = 1; |
46 | - if( (ereg('[^a-zA-Z0-9\.]',$_FILES['filedbf']['name'])) || (!ereg('\.dbf$',$_FILES['filedbf']['name'])) ) | 46 | + if( (ereg('[^a-zA-Z0-9_\.]',$_FILES['filedbf']['name'])) || (!ereg('\.dbf$',$_FILES['filedbf']['name'])) ) |
47 | {$statusNome = 0;} | 47 | {$statusNome = 0;} |
48 | if($statusNome != 1) | 48 | if($statusNome != 1) |
49 | {echo "Arquivos inválidos";exit;} | 49 | {echo "Arquivos inválidos";exit;} |