From c3eb1fa496982ed4cd4bf14c68b29ba88c6bee29 Mon Sep 17 00:00:00 2001 From: Reinaldo Araujo Barreto Junior Date: Thu, 7 Mar 2019 19:38:00 -0300 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20BASE=20=20FIXED=20#132=20corre?= =?UTF-8?q?=C3=A7=C3=A3o=20da=20falha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/classes/webform/TPDOConnection.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/base/classes/webform/TPDOConnection.class.php b/base/classes/webform/TPDOConnection.class.php index 4102d6f3..266d86e1 100644 --- a/base/classes/webform/TPDOConnection.class.php +++ b/base/classes/webform/TPDOConnection.class.php @@ -1149,7 +1149,8 @@ public static function dmy( $date = null ) * @param string $string * @return NULL|string */ - public static function getStrUtf8OrAnsi( $boolUtf8_Decode , $string ) { + public static function getStrUtf8OrAnsi( $boolUtf8_Decode , $string ) + { $retorno = null; if( (self::$banco == DBMS_SQLSERVER) && (PHP_OS != "Linux" ) ){ $retorno = $string; @@ -1157,7 +1158,8 @@ public static function getStrUtf8OrAnsi( $boolUtf8_Decode , $string ) { $retorno = $string; }elseif (self::$banco == DBMS_SQLITE) { $retorno = $string; - } if( self::isMySqlWinDbUtf8() ){ + } + elseif( self::isMySqlWinDbUtf8() ){ $retorno = $string; } else{ if ( $boolUtf8_Decode ) { From d8ae137d2687500bc0c3270e530dadeb9e7d5e56 Mon Sep 17 00:00:00 2001 From: Bjverde Date: Fri, 8 Mar 2019 01:46:13 -0300 Subject: [PATCH 2/2] :bug: BASE FIXED #133 --- base/classes/webform/TPDOConnection.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/base/classes/webform/TPDOConnection.class.php b/base/classes/webform/TPDOConnection.class.php index 266d86e1..e1b2767e 100644 --- a/base/classes/webform/TPDOConnection.class.php +++ b/base/classes/webform/TPDOConnection.class.php @@ -159,22 +159,22 @@ public static function connect( $configFile = null, $boolRequired = true, $boolU } /** - * Verifica se o SGBD é MySQL, rodando no Windows + * Verifica se o SGBD é MySQL * Encoding do banco é UTF 8 * @return boolean */ - public static function isMySqlWinDbUtf8(){ + public static function isMySqlDbUtf8(){ $result = false; $DBMS = self::getDBMS(); $boolUtf8_Decode = self::getUtfDecode(); - if( ($DBMS == DBMS_MYSQL) && (PHP_OS != "Linux" ) && $boolUtf8_Decode==false ){ + if( ($DBMS == DBMS_MYSQL) && $boolUtf8_Decode==false ){ $result = true; } return $result; } public static function getExtraConfigPDO(){ - if( self::isMySqlWinDbUtf8() ){ + if( self::isMySqlDbUtf8() ){ self::$instance[ self::getDatabaseName()]->exec('SET CHARACTER SET utf8'); // acerta a acentuação vinda do banco de dados } } @@ -770,7 +770,7 @@ public static function encodeArray( $arrDados = null ) { foreach( $arrDados as $k => $v ) { if ( ! is_null( $v ) ) { - if( !self::isMySqlWinDbUtf8() ){ + if( !self::isMySqlDbUtf8() ){ $boolUtf8_DecodeDataBase = self::getUtfDecode(); $arrDados[ $k ] = self::getStrUtf8OrAnsi(!$boolUtf8_DecodeDataBase, $v); } @@ -812,7 +812,7 @@ public static function encodeArray( $arrDados = null ) { foreach( $arrDados as $k => $v ) { if ( !is_null($v) && !empty($v) ){ $v = self::verifyformtDateYMD( $v ); - if( !self::isMySqlWinDbUtf8() ){ + if( !self::isMySqlDbUtf8() ){ $boolUtf8_DecodeDataBase = self::getUtfDecode(); $arrDados[ $k ] = self::getStrUtf8OrAnsi(!$boolUtf8_DecodeDataBase, $v); } @@ -1159,7 +1159,7 @@ public static function getStrUtf8OrAnsi( $boolUtf8_Decode , $string ) }elseif (self::$banco == DBMS_SQLITE) { $retorno = $string; } - elseif( self::isMySqlWinDbUtf8() ){ + elseif( self::isMySqlDbUtf8() ){ $retorno = $string; } else{ if ( $boolUtf8_Decode ) {