Skip to content

PHP v7.4.2 error: Trying to access array offset on value of type bool #27

@ulises-salinas

Description

@ulises-salinas
File          : tcpdi_parser.php
Version.      : 1.1
Line.         : 1429 
Method.       :  _getPageRotation()
private function _getPageRotation($obj) { // $obj = /Page
        $obj = $this->getObjectVal($obj);
        if (isset ($obj[1][1]['/Rotate'])) {
            $res = $this->getObjectVal($obj[1][1]['/Rotate']);
            if ($res[0] == PDF_TYPE_OBJECT)
                return $res[1];
            return $res;
        } else {
            if (!isset ($obj[1][1]['/Parent'])) {
                return false;
            } else {
                $res = $this->_getPageRotation($obj[1][1]['/Parent']);
               // <<<<< -------   LINE 1429 
                if ($res && $res[0] == PDF_TYPE_OBJECT)
                    return $res[1];
                return $res;
            }
        }
    } 

FIXED With:

 if ($res && $res[0] == PDF_TYPE_OBJECT)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions