diff --git a/admin/admin.db b/admin/admin.db index df1c9ee..8400306 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/php/classe_metaestat.php b/admin/php/classe_metaestat.php index 3d99f77..db0c8f5 100755 --- a/admin/php/classe_metaestat.php +++ b/admin/php/classe_metaestat.php @@ -2128,7 +2128,7 @@ class Metaestat{ foreach($dados["colunas"] as $t){ $temp = strtoupper($t["field"]); if(strlen($temp) > 10){ - $temp = substr($t["field"],0,8).($cni++); + $temp = substr($temp,0,8).($cni++); } if($t["type"] == "varchar" || $t["type"] == "char" || $t["type"] == "character varying" || $t["type"] == "character" || $t["type"] == "text"){ $def[] = array($temp,"C","254"); diff --git a/admin/php/metaestat.php b/admin/php/metaestat.php index a6403bc..48d4d03 100644 --- a/admin/php/metaestat.php +++ b/admin/php/metaestat.php @@ -1441,6 +1441,7 @@ switch (strtoupper($funcao)) fclose($handle); $ziper = new zipfile(); + $ziper->addFile($contentsshp, basename($shp).'.shp'); $ziper->addFile($contentsshx, basename($shp).'.shx'); $ziper->addFile($contentsdbf, basename($shp).'.dbf'); diff --git a/pacotes/kmlmapserver/classes/zip.class.php b/pacotes/kmlmapserver/classes/zip.class.php index 84f21cf..3ba89db 100644 --- a/pacotes/kmlmapserver/classes/zip.class.php +++ b/pacotes/kmlmapserver/classes/zip.class.php @@ -95,7 +95,9 @@ class zipfile */ function addFile($data, $name, $time = 0) { - $name = str_replace('\\', '/', $name); + //adicionado por edmar moretti + $data = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$data); + $name = str_replace('\\', '/', $name); $dtime = dechex($this->unix2DosTime($time)); $hexdtime = '\x' . $dtime[6] . $dtime[7] @@ -219,7 +221,7 @@ class zipfile */ function output($file) { - $fp=fopen($file,"w"); + $fp=fopen($file,"wb"); fwrite($fp,$this->file()); fclose($fp); } -- libgit2 0.21.2