From 4e629496892b0bb9f3fe78a708950cfea6f1f449 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Fri, 27 Oct 2017 17:06:39 -0200 Subject: [PATCH] Correção no editor de mapfile para evitar perda de strings quando existirem sinais não permitidos no mapfile (usados em expressões) --- admin/admin.db | Bin 352256 -> 0 bytes admin/catalogo/mapfile/editor/funcoes.php | 2 +- admin/catalogo/mapfile/editor/index.php | 11 ++++++----- ferramentas/salvamapfile/index.js | 2 +- temas/_lbairros.map | 24 ++++++++++++------------ temas/_lbiomashp.map | 16 +++------------- 6 files changed, 23 insertions(+), 32 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index d769965..0c7fbbd 100755 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/catalogo/mapfile/editor/funcoes.php b/admin/catalogo/mapfile/editor/funcoes.php index e8527b4..bdf605e 100755 --- a/admin/catalogo/mapfile/editor/funcoes.php +++ b/admin/catalogo/mapfile/editor/funcoes.php @@ -195,7 +195,7 @@ function salvaMapfile() $layer = $mapa->getlayerbyname($codigo); if ($layer == "") { - return "
Atenção: não existe nenhum LAYER com NAME igual a " . $codigo . "
"; + return "
Atenção: não existe nenhum LAYER com NAME igual a " . $codigo . "
"; } else { // pega o metadata $meta = $layer->getmetadata("permitedownload"); diff --git a/admin/catalogo/mapfile/editor/index.php b/admin/catalogo/mapfile/editor/index.php index d329e1e..ccfbaa6 100755 --- a/admin/catalogo/mapfile/editor/index.php +++ b/admin/catalogo/mapfile/editor/index.php @@ -3,6 +3,11 @@ // TODO editor de cores // +//nao tire daqui ou as expressoes podem ser sanitizadas +if (isset ( $_POST ["texto"] )) { + $gravarTexto = $_POST ["texto"]; + $_POST ["texto"] = ""; +} /****************************************************************/ //include ("exec.php"); // @@ -14,7 +19,6 @@ include ("../../../php/checaLogin.php"); \admin\php\login\checaLogin(); - //$k = filter_var ( $k, FILTER_SANITIZE_STRING ); //funcoes de administracao @@ -39,10 +43,6 @@ define ( "ONDEI3GEO", "../../../.." ); include "../../../head.php"; $codigo = filter_var ( $_GET ["codigo"], FILTER_SANITIZE_STRING ); $id_tema = ( int ) $_GET ["id_tema"]; -if (isset ( $_POST ["texto"] )) { - $gravarTexto = $_POST ["texto"]; - $_POST ["texto"] = ""; -} if (\admin\php\funcoesAdmin\verificaOperacaoSessao ( "admin/html/editortexto" ) === false) { header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" ); @@ -50,6 +50,7 @@ if (\admin\php\funcoesAdmin\verificaOperacaoSessao ( "admin/html/editortexto" ) } $versao = \admin\php\funcoesAdmin\versao (); $versao = $versao ["principal"]; + \admin\catalogo\mapfile\editor\salvaMapfile (); $textoMapfile = \admin\catalogo\mapfile\editor\textoMapfile ( $codigo ); ?> diff --git a/ferramentas/salvamapfile/index.js b/ferramentas/salvamapfile/index.js index ff12dd3..00eecfd 100755 --- a/ferramentas/salvamapfile/index.js +++ b/ferramentas/salvamapfile/index.js @@ -129,7 +129,7 @@ i3GEOF.salvamapfile = { titulo = "" + $trad("x55") + ""; janela = i3GEO.janela.cria( "340px", - "160px", + "260px", "", "", "", diff --git a/temas/_lbairros.map b/temas/_lbairros.map index 91ddde9..78422d4 100755 --- a/temas/_lbairros.map +++ b/temas/_lbairros.map @@ -1,13 +1,13 @@ MAP - FONTSET "/var/www/i3geo/symbols/fontes.txt" - SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym" + FONTSET "/var/www/i3geo/symbols/fontes.txt" + SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym" LAYER - CONNECTION "user=postgres password=postgres dbname=i3geosaude host=localhost port=5432" + CONNECTION "i3geosaude" CONNECTIONTYPE POSTGIS DATA "the_geom from (select gid, st_setsrid(the_geom,4326) as the_geom,co_bairro,no_bairro,no_distr,no_municip from i3geo_metaestat.bairros ) as foo using unique co_bairro using srid=4326" METADATA - "cache" "sim" "TIP" "no_bairro,id" + "cache" "sim" "CLASSE" "SIM" "permitekmz" "SIM" "ITENSDESC" "id,Código bairro,Nome,Distrito,Município" @@ -18,11 +18,11 @@ MAP "permitecomentario" "NAO" "escondido" "NAO" "download" "SIM" - "CONEXAOORIGINAL" "i3geosaude" "ITENS" "gid,co_bairro,no_bairro,no_distr,no_municip" - "permitekml" "SIM" - "permiteogc" "SIM" + "CONEXAOORIGINAL" "i3geosaude" "transitioneffect" "NAO" + "permiteogc" "SIM" + "permitekml" "SIM" "TEMA" "_Bairros POSTGIS" "identifica" "sim" END # METADATA @@ -35,13 +35,13 @@ MAP TYPE POLYGON UNITS METERS CLASS - NAME "" + NAME " " STYLE - OUTLINECOLOR 255 100 0 - END # STYLE - TITLE "" + COLOR 255 0 0 + OUTLINECOLOR 255 255 255 + END END # CLASS - END # LAYER + END # LAYER END # MAP diff --git a/temas/_lbiomashp.map b/temas/_lbiomashp.map index 4311a17..1e0bf58 100755 --- a/temas/_lbiomashp.map +++ b/temas/_lbiomashp.map @@ -1,6 +1,6 @@ MAP - FONTSET "../symbols/fontes.txt" - SYMBOLSET "../symbols/simbolosv6.sym" + FONTSET "../symbols/fontes.txt" + SYMBOLSET "../symbols/simbolosv6.sym" LAYER COMPOSITE OPACITY 50 @@ -11,23 +11,15 @@ MAP "TIP" "CD_LEGENDA" "cache" "sim" "CLASSE" "SIM" - "olopacity" "" "animagif" "" "permitekmz" "SIM" - "gmopacity" "" - "gmstatus" "" "ITENSDESC" "Teste de acentuação" "TILES" "SIM" "ESCALA" "250000" "editavel" "" - "arquivotemaoriginal" "" "extensao" "-73.990940816816 -33.74827031115 -34.822855820777 5.272224303909" - "nomeoriginal" "" - "olstatus" "" "permitedownload" "SIM" - "FILTROORIGINAL" "" "permitecomentario" "NAO" - "DATAORIGINAL" "" "escondido" "NAO" "download" "SIM" "esquematabelaeditavel" "" @@ -58,7 +50,7 @@ MAP NAME "CAATINGA" EXPRESSION ('[CD_LEGENDA]'eq'CAATINGA') STYLE - COLOR 183 247 169 + COLOR 50 247 169 OUTLINECOLOR 255 255 255 END # STYLE TITLE "" @@ -109,6 +101,4 @@ MAP TITLE "" END # CLASS END # LAYER - END # MAP - -- libgit2 0.21.2