mpdf / mpdf.github.io

mPDF documentation
https://mpdf.github.io
Other
504 stars 160 forks source link

Trying to access array offset on value of type null #200

Closed fglueck closed 6 months ago

fglueck commented 6 months ago

Mpdf.php line 16129 and follow:

        for ($i = 0; $i < $array_size; $i++) {
            // COLS
            $oldcolumn = $this->CurrCol;
            $vetor = isset($arrayaux[$i]) ? $arrayaux[$i] : null; // <<--- set to NULL
            if ($i == 0 && $vetor[0] != "\n" && ! $this->ispre) {  ( 
                $vetor[0] = ltrim($vetor[0]);
                if (!empty($vetor[18])) {
                    $this->otl->trimOTLdata($vetor[18], true, false);
                } // *OTL*
            }
            // FIXED TO ALLOW IT TO SHOW '0'
            if (empty($vetor[0]) && !($vetor[0] === '0') && empty($vetor[7])) { // Ignore empty text and not carrying an internal link
                // Check if it is the last element. If so then finish printing the block
                if ($i == ($array_size - 1)) {
                    $this->finishFlowingBlock(true);
                } // true = END of flowing block
                continue;
            }

$vetor[0] access generates some errors/warnings.