diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 85404ff..9f7e056 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,8 @@ +6.0.044 (2013-11-10) + - Bug #857 "Undefined offset error" was fixed. + - The uniord method now uses a static cache to improve performances (thanks to Mathieu Masseboeuf for the sugegstion). + - Two bugs in the TCPDF_FONTS class were fixed. + 6.0.043 (2013-10-29) - Bug #854 "CSS instruction display" was fixed. diff --git a/README.TXT b/README.TXT index d7b9f59..c4932ba 100644 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 6.0.043 -Release date: 2013-10-29 +Version: 6.0.044 +Release date: 2013-11-10 Author: Nicola Asuni Copyright (c) 2002-2013: diff --git a/composer.json b/composer.json index 916313c..fecf0d6 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "6.0.043", + "version": "6.0.044", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/include/tcpdf_fonts.php b/include/tcpdf_fonts.php index 53f4eb5..72b0a92 100644 --- a/include/tcpdf_fonts.php +++ b/include/tcpdf_fonts.php @@ -1,9 +1,9 @@ + * Uses the getUniord() method if the value is not cached. + * @param $uch (string) character string to process. + * @return integer Unicode value + * @public static + */ + public static function uniord($uch) { + if (!isset(self::$cache_uniord[$uch])) { + self::$cache_uniord[$uch] = self::getUniord($uch); + } + return self::$cache_uniord[$uch]; + } + /** * Converts UTF-8 character to integer value.
* Invalid byte sequences will be replaced with 0xFFFD (replacement character)
@@ -1789,7 +1809,7 @@ class TCPDF_FONTS { * @author Nicola Asuni * @public static */ - public static function uniord($uch) { + public static function getUniord($uch) { if (function_exists('mb_convert_encoding')) { list(, $char) = @unpack('N', mb_convert_encoding($uch, 'UCS-4BE', 'UTF-8')); if ($char >= 0) { diff --git a/include/tcpdf_static.php b/include/tcpdf_static.php index ab7dc38..ad3bacc 100644 --- a/include/tcpdf_static.php +++ b/include/tcpdf_static.php @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.0.043'; + private static $tcpdf_version = '6.0.044'; /** * String alias for total number of pages. diff --git a/tcpdf.php b/tcpdf.php index 983d70c..7c95d5a 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,7 +1,7 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.0.043 + * @version 6.0.044 */ // TCPDF configuration @@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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 6.0.043 + * @version 6.0.044 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -9404,7 +9404,7 @@ class TCPDF { } if (!TCPDF_STATIC::empty_string($this->keywords)) { // Keywords associated with the document. - $out .= ' /Keywords '.$this->_textstring($this->keywords.' TCPDF', $oid); + $out .= ' /Keywords '.$this->_textstring($this->keywords, $oid); } if (!TCPDF_STATIC::empty_string($this->creator)) { // If the document was converted to PDF from another format, the name of the conforming product that created the original document from which it was converted. @@ -9473,7 +9473,7 @@ class TCPDF { $xmp .= "\t\t\t".''."\n"; $xmp .= "\t\t\t".''."\n"; $xmp .= "\t\t\t\t".''."\n"; - $xmp .= "\t\t\t\t\t".''.TCPDF_STATIC::_escapeXML($this->keywords).' TCPDF'."\n"; + $xmp .= "\t\t\t\t\t".''.TCPDF_STATIC::_escapeXML($this->keywords).''."\n"; $xmp .= "\t\t\t\t".''."\n"; $xmp .= "\t\t\t".''."\n"; $xmp .= "\t\t".''."\n"; @@ -9496,7 +9496,7 @@ class TCPDF { $xmp .= "\t\t\t".''.$doccreationdate.''."\n"; $xmp .= "\t\t".''."\n"; $xmp .= "\t\t".''."\n"; - $xmp .= "\t\t\t".''.TCPDF_STATIC::_escapeXML($this->keywords).' TCPDF'."\n"; + $xmp .= "\t\t\t".''.TCPDF_STATIC::_escapeXML($this->keywords).''."\n"; $xmp .= "\t\t\t".''.TCPDF_STATIC::_escapeXML(TCPDF_STATIC::getTCPDFProducer()).''."\n"; $xmp .= "\t\t".''."\n"; $xmp .= "\t\t".''."\n"; @@ -17613,6 +17613,9 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: case 'l': { // get current X position preg_match('/([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $xmatches); + if (!isset($xmatches[1])) { + break; + } $currentxpos = $xmatches[1]; $textpos = $currentxpos; if (($strcount <= $maxkk) AND ($strpiece[2][0] == 'Td')) { @@ -17636,6 +17639,9 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: continue; } preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches); + if (!isset($xmatches[1])) { + break; + } $currentxpos = $xmatches[1]; global $x_diff, $w_diff; $x_diff = 0; @@ -17675,6 +17681,9 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: case 'c': { // get current X position preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x', $pmid, $xmatches); + if (!isset($xmatches[1])) { + break; + } $currentxpos = $xmatches[1]; // justify block $pmid = preg_replace_callback('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$xmatches[4].')[\s]('.$xmatches[5].')[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x',