Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tcpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -19315,7 +19315,7 @@ protected function openHTMLTagHandler($dom, $key, $cell) {
if ($key > 2) {
$this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag);
}
if ($this->listordered[$this->listnum]) {
if (!empty($this->listordered[$this->listnum])) {
// ordered item
if (isset($parent['attribute']['type']) AND !TCPDF_STATIC::empty_string($parent['attribute']['type'])) {
$this->lispacer = $parent['attribute']['type'];
Expand All @@ -19326,6 +19326,9 @@ protected function openHTMLTagHandler($dom, $key, $cell) {
} else {
$this->lispacer = '#';
}
if (!isset($this->listcount[$this->listnum])) {
$this->listcount[$this->listnum] = 0;
}
++$this->listcount[$this->listnum];
if (isset($tag['attribute']['value'])) {
$this->listcount[$this->listnum] = intval($tag['attribute']['value']);
Expand Down Expand Up @@ -20686,7 +20689,7 @@ protected function putHtmlListBullet($listdepth, $listtype='', $size=10) {
} elseif ($listtype == '!') {
// set default list type for unordered list
$deftypes = array('disc', 'circle', 'square');
$listtype = $deftypes[($listdepth - 1) % 3];
$listtype = $deftypes[max(0, ($listdepth - 1) % 3)];
} elseif ($listtype == '#') {
// set default list type for ordered list
$listtype = 'decimal';
Expand Down Expand Up @@ -20769,7 +20772,7 @@ protected function putHtmlListBullet($listdepth, $listtype='', $size=10) {
// $textitem
case '1':
case 'decimal': {
$textitem = $this->listcount[$this->listnum];
$textitem = $this->listcount[$this->listnum] ?? '';
break;
}
case 'decimal-leading-zero': {
Expand Down Expand Up @@ -20830,7 +20833,7 @@ protected function putHtmlListBullet($listdepth, $listtype='', $size=10) {
}
*/
default: {
$textitem = $this->listcount[$this->listnum];
$textitem = $this->listcount[$this->listnum] ?? '';
}
}
if (!TCPDF_STATIC::empty_string($textitem)) {
Expand Down