Skip to content

Commit 6f723a9

Browse files
committed
Release 8.2.3
2 parents 596a87b + c863e19 commit 6f723a9

File tree

10 files changed

+63
-11
lines changed

10 files changed

+63
-11
lines changed

.github/SECURITY.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ How to disclose potential security issues
22
============
33

44
As mPDF does not have a domain or a dedicated contact apart from its Github repository, to prevent
5-
disclosing maintainers' contacts publicly, please create an Issue about the security issue with means to contact you.
6-
We will reach out to you as soon as possible.
5+
disclosing maintainers' contacts publicly, please use [GitHub's Security Advisories system](https://github.com/mpdf/mpdf/security/advisories).

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: "Checkout"
28-
uses: "actions/checkout@v3"
28+
uses: "actions/checkout@v4"
2929

3030
- name: "Install PHP"
3131
uses: "shivammathur/setup-php@v2"

.github/workflows/cs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: "Checkout"
29-
uses: "actions/checkout@v3"
29+
uses: "actions/checkout@v4"
3030

3131
- name: "Install PHP"
3232
uses: "shivammathur/setup-php@v2"

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: "Checkout"
39-
uses: "actions/checkout@v3"
39+
uses: "actions/checkout@v4"
4040

4141
- name: "Install PHP"
4242
uses: "shivammathur/setup-php@v2"

src/Color/ColorConverter.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ private function convertPlain($color, array &$PDFAXwarnings = [])
193193
} elseif (strpos($color, '#') === 0) { // case of #nnnnnn or #nnn
194194
$c = $this->processHashColor($color);
195195
} elseif (preg_match('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\((.*?)\)/', $color, $m)) {
196-
// quickfix for color containing CSS variable
197-
preg_match('/var\(--([a-z-_]+)\)/i', $m[0], $var);
198-
if ($var) {
196+
// ignore colors containing CSS variables
197+
if (str_starts_with(mb_strtolower($m[2]), 'var(--')) {
199198
$m[2] = '0, 0, 0, 100';
200199
}
201200
$c = $this->processModeColor($m[1], explode(',', $m[2]));

src/Mpdf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
3232
use FpdiTrait;
3333
use MpdfPsrLogAwareTrait;
3434

35-
const VERSION = '8.2.2';
35+
const VERSION = '8.2.3';
3636

3737
const SCALE = 72 / 25.4;
3838

@@ -13231,7 +13231,7 @@ function Footer()
1323113231

1323213232
/* -- WATERMARK -- */
1323313233
if (($this->watermarkText) && ($this->showWatermarkText)) {
13234-
$this->watermark($this->watermarkText, $this->watermarkAngle, 120, $this->watermarkTextAlpha); // Watermark text
13234+
$this->watermark($this->watermarkText, $this->watermarkAngle, is_int($this->watermark_size) ? $this->watermark_size : 120, $this->watermarkTextAlpha); // Watermark text
1323513235
}
1323613236
if (($this->watermarkImage) && ($this->showWatermarkImage)) {
1323713237
$this->watermarkImg($this->watermarkImage, $this->watermarkImageAlpha); // Watermark image

src/Otl.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,10 @@ function _applyGSUBrulesIndic($usetags, $scriptTag, $langsys, $is_old_spec)
15391539
continue;
15401540
}
15411541

1542+
if (!isset($this->OTLdata[$ptr + 1])) {
1543+
continue;
1544+
}
1545+
15421546
$nextGlyph = $this->OTLdata[$ptr + 1]['hex'];
15431547
$nextGID = $this->OTLdata[$ptr + 1]['uni'];
15441548
if (isset($this->GSLuCoverage[$lu][$c][$nextGID])) {

src/Tag/Option.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public function open($attr, &$ahtml, &$ihtml)
2727
$attr['VALUE'] = mb_convert_encoding($attr['VALUE'], $this->mpdf->mb_enc, 'UTF-8');
2828
}
2929
}
30-
$this->mpdf->selectoption['currentVAL'] = $attr['VALUE'];
30+
31+
$this->mpdf->selectoption['currentVAL'] = isset($attr['VALUE']) ? $attr['VALUE'] : $ahtml[$ihtml + 1];
3132
}
3233

3334
public function close(&$ahtml, &$ihtml)

tests/Issues/Issue1934Test.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Issues;
4+
5+
use Mpdf\Tag\Option;
6+
use Mpdf\Cache;
7+
use Mpdf\CssManager;
8+
use Mpdf\Form;
9+
use Mpdf\Otl;
10+
use Mpdf\TableOfContents;
11+
use Mpdf\SizeConverter;
12+
use Mpdf\Image\ImageProcessor;
13+
use Mpdf\Language\LanguageToFontInterface;
14+
use Mpdf\Color\ColorConverter;
15+
16+
class Issue1934Test extends \Mpdf\BaseMpdfTest
17+
{
18+
public function testWithFailingHtmlSnippet()
19+
{
20+
$html = '<select><option value="this option tag has the value">Option 1</option><option selected>Option 2</option></select>';
21+
22+
$this->mpdf->WriteHTML($html);
23+
}
24+
}

tests/Issues/Issue1963Test.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Issues;
4+
5+
use Mpdf\BaseMpdfTest;
6+
use Mpdf\Mpdf;
7+
use Mpdf\Output\Destination;
8+
9+
class Issue1963Test extends BaseMpdfTest
10+
{
11+
public function testNoWarning()
12+
{
13+
$mpdf = new Mpdf([
14+
'mode' => '-aCJK',
15+
'autoScriptToLang' => true,
16+
'autoLangToFont' => true,
17+
'default_font' => 'dejavusans',
18+
]);
19+
20+
$mpdf->WriteHTML('<p>न्</p>');
21+
$output = $mpdf->OutputBinaryData();
22+
23+
$this->assertStringStartsWith('%PDF-', $output);
24+
}
25+
}

0 commit comments

Comments
 (0)