From c13969b5f464464e158583a5b9d47ff7a8555564 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Mon, 27 Oct 2014 13:38:36 -0400 Subject: [PATCH] PM-795 se visualizan caracteres extras en el texto de un output document con PHP 5.4 SOLVED --- gulliver/system/class.g.php | 46 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 3302ba17f..b57271db8 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -2918,7 +2918,11 @@ class G */ public function unhtmlentities ($string) { - $trans_tbl = get_html_translation_table( HTML_ENTITIES ); + if (version_compare(PHP_VERSION, '5.4.0', '<')) { + $trans_tbl = get_html_translation_table( HTML_ENTITIES ); + } else { + $trans_tbl = get_html_translation_table( HTML_ENTITIES, ENT_COMPAT, 'ISO-8859-1' ); + } foreach ($trans_tbl as $k => $v) { $ttr[$v] = utf8_encode( $k ); } @@ -4392,9 +4396,9 @@ class G } elseif (preg_match( '/Firefox/i', $u_agent )) { $bname = 'Mozilla Firefox'; $ub = "Firefox"; - } elseif ((preg_match( '/Opera/i', $u_agent )) || (preg_match( '/OPR/i', $u_agent ))) { - $bname = 'Opera'; - $ub = "Opera"; + } elseif ((preg_match( '/Opera/i', $u_agent )) || (preg_match( '/OPR/i', $u_agent ))) { + $bname = 'Opera'; + $ub = "Opera"; } elseif (preg_match( '/Chrome/i', $u_agent )) { $bname = 'Google Chrome'; $ub = "Chrome"; @@ -5324,8 +5328,7 @@ class G return $arrayData; } - public static function buildFrom($configuration, $from = '') - { + public static function buildFrom($configuration, $from = '') { if (!isset($configuration['MESS_FROM_NAME'])) { $configuration['MESS_FROM_NAME'] = ''; } @@ -5536,23 +5539,22 @@ class G } } - /** - * Check the browser compativility - */ - public function checkBrowserCompatibility($browser = null, $version = null) - { - if ($browser == null || $version == null) { - $info = G::getBrowser(); - $browser = $info['name']; - $version = $info['version']; - } - if ((($browser== 'msie') && (($version >= 8) && ($version <= 11))) || + /** + * Check the browser compativility + */ + public function checkBrowserCompatibility($browser = null, $version = null){ + if($browser == null || $version == null){ + $info = G::getBrowser(); + $browser = $info['name']; + $version = $info['version']; + } + if ((($browser== 'msie') && (($version >= 8) && ($version <= 11))) || (($browser== 'chrome') && ($version >= 26)) || - (($browser== 'firefox') && ($version >= 20)) - ) { - return true; - } - return false; + (($browser== 'firefox') && ($version >= 20)) + ){ + return true; + } + return false; } /*