Skip to content

Wrong default value when $table_el['old_cell_padding'] is missing #806

@kristofferwiklund

Description

@kristofferwiklund

In tcpdf.php

TCPDF/tcpdf.php

Line 20015 in d0e8dd1

$this->cell_padding = isset($table_el['old_cell_padding']) ? $table_el['old_cell_padding'] : null;

When we do not have an old $table_el['old_cell_padding'] we fallback to null. That is incorrect. We should fallback to a default array. Otherwise the end up with a lot of :
Warning: Trying to access array offset on null in TCPDF->adjustCellPadding()

The line should be:

$this->cell_padding = isset($table_el['old_cell_padding']) ? $table_el['old_cell_padding'] : array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions