Skip to content

Commit 80c9fd4

Browse files
authored
Merge pull request #3 from ohgoodlord/feature/fix-tcpdi-parser-bool
Fix tcpdi_parser
2 parents 08ccc22 + 5d8c386 commit 80c9fd4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tcpdf/tcpdi_parser.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ private function _getPageBoxes($page, $k) {
13851385
* Get the page rotation by pageno
13861386
*
13871387
* @param integer $pageno
1388-
* @return array
1388+
* @return array|bool
13891389
*/
13901390
public function getPageRotation($pageno) {
13911391
return $this->_getPageRotation($this->pages[$pageno - 1]);
@@ -1395,15 +1395,15 @@ private function _getPageRotation($obj) { // $obj = /Page
13951395
$obj = $this->getObjectVal($obj);
13961396
if (isset ($obj[1][1]['/Rotate'])) {
13971397
$res = $this->getObjectVal($obj[1][1]['/Rotate']);
1398-
if ($res[0] == PDF_TYPE_OBJECT)
1398+
if (is_array($res) && $res[0] == PDF_TYPE_OBJECT)
13991399
return $res[1];
14001400
return $res;
14011401
} else {
14021402
if (!isset ($obj[1][1]['/Parent'])) {
14031403
return false;
14041404
} else {
14051405
$res = $this->_getPageRotation($obj[1][1]['/Parent']);
1406-
if ($res[0] == PDF_TYPE_OBJECT)
1406+
if (is_array($res) && $res[0] == PDF_TYPE_OBJECT)
14071407
return $res[1];
14081408
return $res;
14091409
}

0 commit comments

Comments
 (0)