Skip to content

Commit

Permalink
Fix "Undefined array key _ in Otl.php:1542" (Closes mpdf#1962)
Browse files Browse the repository at this point in the history
* Fix "Undefined array key _ in Otl.php:1542"

---------

Co-authored-by: Mikhailov Nikolai <[email protected]>
  • Loading branch information
sonnymilton and Mikhailov Nikolai authored Dec 4, 2023
1 parent d748f1e commit 00a35a6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Otl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,10 @@ function _applyGSUBrulesIndic($usetags, $scriptTag, $langsys, $is_old_spec)
continue;
}

if (!isset($this->OTLdata[$ptr + 1])) {
continue;
}

$nextGlyph = $this->OTLdata[$ptr + 1]['hex'];
$nextGID = $this->OTLdata[$ptr + 1]['uni'];
if (isset($this->GSLuCoverage[$lu][$c][$nextGID])) {
Expand Down
25 changes: 25 additions & 0 deletions tests/Issues/Issue1963Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Issues;

use Mpdf\BaseMpdfTest;
use Mpdf\Mpdf;
use Mpdf\Output\Destination;

class Issue1963Test extends BaseMpdfTest
{
public function testNoWarning()
{
$mpdf = new Mpdf([
'mode' => '-aCJK',
'autoScriptToLang' => true,
'autoLangToFont' => true,
'default_font' => 'dejavusans',
]);

$mpdf->WriteHTML('<p>न्</p>');
$output = $mpdf->OutputBinaryData();

$this->assertStringStartsWith('%PDF-', $output);
}
}

0 comments on commit 00a35a6

Please sign in to comment.