diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 3b87c8c..13ec807 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.182 (2012-09-05) + - Bug item #3564982 "Infinite loop in Write() method" was fixed. + 5.9.181 (2012-08-31) - composer.json file was added. - Bug item #3563369 "Cached images are not unlinked some time" was fixed. diff --git a/README.TXT b/README.TXT index 1d0fc01..ec49ccc 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.181 -Release date: 2012-08-31 +Version: 5.9.182 +Release date: 2012-09-05 Author: Nicola Asuni Copyright (c) 2002-2012: diff --git a/tcpdf.php b/tcpdf.php index c5109bf..b11200e 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.181 + * @version 5.9.182 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -150,7 +150,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php'); * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.181 + * @version 5.9.182 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -161,7 +161,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.181'; + private $tcpdf_version = '5.9.182'; // Protected properties @@ -7237,6 +7237,10 @@ class TCPDF { $chrwidth = $this->GetCharWidth(46); // dot character // get array of unicode values $chars = $this->UTF8StringToArray($s); + // calculate maximum width for a single character on string + $chrw = $this->GetArrStringWidth($chars, '', '', 0, true); + array_walk($chrw, array($this, 'getRawCharWidth')); + $maxchwidth = max($chrw); // get array of chars $uchars = $this->UTF8ArrayToUniArray($chars); // get the number of characters @@ -7261,8 +7265,8 @@ class TCPDF { if (!$firstline) { $wmax -= ($this->cell_padding['L'] + $this->cell_padding['R']); } - if ((!$firstline) AND (($chrwidth > $wmax) OR ($this->GetCharWidth($chars[0]) > $wmax))) { - // a single character do not fit on column + if ((!$firstline) AND (($chrwidth > $wmax) OR ($maxchwidth > $wmax))) { + // the maximum width character do not fit on column return ''; } // minimum row height