TCPDF icon indicating copy to clipboard operation
TCPDF copied to clipboard

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

Open kristofferwiklund opened this issue 9 months ago • 2 comments

In tcpdf.php https://github.com/tecnickcom/TCPDF/blob/d0e8dd17f8a1df3c97b94b9af8356e88e811ed59/tcpdf.php#L20015

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);

kristofferwiklund avatar May 13 '25 12:05 kristofferwiklund

Please open a pull-request

williamdes avatar May 13 '25 12:05 williamdes

Done that now.

kristofferwiklund avatar May 13 '25 12:05 kristofferwiklund