import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -17,9 +17,13 @@
* @subpackage FileParser
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Font.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: Font.php 18993 2009-11-15 17:09:16Z alexander $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Font.php';
/** Zend_Pdf_FileParser */
require_once 'Zend/Pdf/FileParser.php';
@ -206,8 +210,8 @@ abstract class Zend_Pdf_FileParser_Font extends Zend_Pdf_FileParser
$message = vsprintf($message, $args);
}
require_once 'Zend/Log.php';
$logger = new Zend_Log();
$logger->log($message, Zend_Log::DEBUG);
}
}

View File

@ -17,16 +17,12 @@
* @subpackage FileParser
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: OpenType.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: OpenType.php 18993 2009-11-15 17:09:16Z alexander $
*/
/** Zend_Pdf_FileParser_Font */
require_once 'Zend/Pdf/FileParser/Font.php';
/** Zend_Pdf_Cmap */
require_once 'Zend/Pdf/Cmap.php';
/**
* Abstract base class for OpenType font file parsers.
*
@ -166,6 +162,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
* are defined, so use 50 as a practical limit.
*/
if (($tableCount < 7) || ($tableCount > 50)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Table count not within expected range',
Zend_Pdf_Exception::BAD_TABLE_COUNT);
}
@ -196,10 +193,12 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
*/
$fileSize = $this->_dataSource->getSize();
if (($tableOffset < 0) || ($tableOffset > $fileSize)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Table offset ($tableOffset) not within expected range",
Zend_Pdf_Exception::INDEX_OUT_OF_RANGE);
}
if (($tableLength < 0) || (($tableOffset + $tableLength) > $fileSize)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Table length ($tableLength) not within expected range",
Zend_Pdf_Exception::INDEX_OUT_OF_RANGE);
}
@ -232,6 +231,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
$magicNumber = $this->readUInt(4);
if ($magicNumber != 0x5f0f3cf5) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Wrong magic number. Expected: 0x5f0f3cf5; actual: '
. sprintf('%x', $magicNumber),
Zend_Pdf_Exception::BAD_MAGIC_NUMBER);
@ -292,6 +292,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
*/
$tableFormat = $this->readUInt(2);
if ($tableFormat != 0) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Unable to read format $tableFormat table",
Zend_Pdf_Exception::DONT_UNDERSTAND_TABLE_VERSION);
}
@ -492,6 +493,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
protected function _parseOs2Table()
{
if (! $this->numberHMetrics) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("hhea table must be parsed prior to calling this method",
Zend_Pdf_Exception::PARSED_OUT_OF_ORDER);
}
@ -501,6 +503,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
} catch (Zend_Pdf_Exception $exception) {
/* This table is not always present. If missing, use default values.
*/
require_once 'Zend/Pdf/Exception.php';
if ($exception->getCode() == Zend_Pdf_Exception::REQUIRED_TABLE_NOT_FOUND) {
$this->_debugLog('No OS/2 table found. Using default values');
$this->fontWeight = Zend_Pdf_Font::WEIGHT_NORMAL;
@ -547,6 +550,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
*/
$tableVersion = $this->readUInt(2);
if (($tableVersion < 0) || ($tableVersion > 3)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Unable to read version $tableVersion table",
Zend_Pdf_Exception::DONT_UNDERSTAND_TABLE_VERSION);
}
@ -728,6 +732,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
$this->_jumpToTable('hmtx');
if (! $this->numberHMetrics) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("hhea table must be parsed prior to calling this method",
Zend_Pdf_Exception::PARSED_OUT_OF_ORDER);
}
@ -735,6 +740,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
/* We only understand version 0 tables.
*/
if ($this->metricDataFormat != 0) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Unable to read format $this->metricDataFormat table.",
Zend_Pdf_Exception::DONT_UNDERSTAND_TABLE_VERSION);
}
@ -787,6 +793,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
*/
$tableVersion = $this->readUInt(2);
if ($tableVersion != 0) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Unable to read version $tableVersion table",
Zend_Pdf_Exception::DONT_UNDERSTAND_TABLE_VERSION);
}
@ -915,6 +922,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
break;
}
if ($cmapType == -1) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Unable to find usable cmap table',
Zend_Pdf_Exception::CANT_FIND_GOOD_CMAP);
}
@ -925,6 +933,8 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
$cmapType, $cmapOffset, $cmapLength);
$this->moveToOffset($cmapOffset);
$cmapData = $this->readBytes($cmapLength);
require_once 'Zend/Pdf/Cmap.php';
$this->cmap = Zend_Pdf_Cmap::cmapWithTypeData($cmapType, $cmapData);
}
@ -964,10 +974,12 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
break;
case 0x74797031: // 'typ1'
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Unsupported font type: PostScript in sfnt wrapper',
Zend_Pdf_Exception::WRONG_FONT_TYPE);
default:
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Not an OpenType font file',
Zend_Pdf_Exception::WRONG_FONT_TYPE);
}
@ -984,6 +996,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
protected function _jumpToTable($tableName)
{
if (empty($this->_tableDirectory[$tableName])) { // do not allow NULL or zero
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Required table '$tableName' not found!",
Zend_Pdf_Exception::REQUIRED_TABLE_NOT_FOUND);
}
@ -1005,6 +1018,7 @@ abstract class Zend_Pdf_FileParser_Font_OpenType extends Zend_Pdf_FileParser_Fon
{
$tableVersion = $this->readFixed(16, 16);
if (($tableVersion < $minVersion) || ($tableVersion > $maxVersion)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Unable to read version $tableVersion table",
Zend_Pdf_Exception::DONT_UNDERSTAND_TABLE_VERSION);
}

View File

@ -17,13 +17,13 @@
* @subpackage FileParser
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TrueType.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: TrueType.php 18993 2009-11-15 17:09:16Z alexander $
*/
/** Zend_Pdf_FileParser_Font_OpenType */
require_once 'Zend/Pdf/FileParser/Font/OpenType.php';
/**
* Parses an OpenType font file containing TrueType outlines.
*
@ -60,6 +60,7 @@ class Zend_Pdf_FileParser_Font_OpenType_TrueType extends Zend_Pdf_FileParser_Fon
break;
default:
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Not a TrueType font file',
Zend_Pdf_Exception::WRONG_FONT_TYPE);
}

View File

@ -17,12 +17,17 @@
* @subpackage FileParser
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Image.php 17182 2009-07-27 13:54:11Z alexander $
* @version $Id: Image.php 18993 2009-11-15 17:09:16Z alexander $
*/
/**
* @see Zend_Pdf_FileParser
*/
/** Internally used classes */
/** Zend_Pdf_Image */
require_once 'Zend/Pdf/Image.php';
/** Zend_Pdf_FileParser */
require_once 'Zend/Pdf/FileParser.php';
/**
@ -55,5 +60,4 @@ abstract class Zend_Pdf_FileParser_Image extends Zend_Pdf_FileParser
parent::__construct($dataSource);
$this->imageType = Zend_Pdf_Image::TYPE_UNKNOWN;
}
}

View File

@ -17,7 +17,7 @@
* @subpackage FileParser
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Png.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Png.php 18993 2009-11-15 17:09:16Z alexander $
*/
/** Zend_Pdf_FileParser_Image */
@ -178,6 +178,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
while($size - $this->getOffset() >= 8) {
$chunkLength = $this->readUInt(4);
if($chunkLength < 0 || ($chunkLength + $this->getOffset() + 4) > $size) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("PNG Corrupt: Invalid Chunk Size In File.");
}
@ -208,6 +209,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
}
}
if(empty($this->_imageData)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception ( "This PNG is corrupt. All png must contain IDAT chunks." );
}
}
@ -215,6 +217,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
protected function _parseIHDRChunk() {
$this->moveToOffset(12); //IHDR must always start at offset 12 and run for 17 bytes
if(!$this->readBytes(4) == 'IHDR') {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception( "This PNG is corrupt. The first chunk in a PNG file must be IHDR." );
}
$this->_width = $this->readUInt(4);
@ -225,6 +228,7 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
$this->_preFilter = $this->readInt(1);
$this->_interlacing = $this->readInt(1);
if($this->_interlacing != Zend_Pdf_Image::PNG_INTERLACING_DISABLED) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception( "Only non-interlaced images are currently supported." );
}
}
@ -317,10 +321,9 @@ class Zend_Pdf_FileParser_Image_Png extends Zend_Pdf_FileParser_Image
case Zend_Pdf_Image::PNG_CHANNEL_GRAY_ALPHA:
//Fall through to the next case
case Zend_Pdf_Image::PING_CHANNEL_RGB_ALPHA:
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception( "tRNS chunk illegal for Alpha Channel Images" );
break;
}
}
}