Skip to content

Commit

Permalink
Release 8.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
finwe committed Mar 11, 2024
2 parents 596a87b + c863e19 commit 6f723a9
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ How to disclose potential security issues
============

As mPDF does not have a domain or a dedicated contact apart from its Github repository, to prevent
disclosing maintainers' contacts publicly, please create an Issue about the security issue with means to contact you.
We will reach out to you as soon as possible.
disclosing maintainers' contacts publicly, please use [GitHub's Security Advisories system](https://github.com/mpdf/mpdf/security/advisories).
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand Down
5 changes: 2 additions & 3 deletions src/Color/ColorConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ private function convertPlain($color, array &$PDFAXwarnings = [])
} elseif (strpos($color, '#') === 0) { // case of #nnnnnn or #nnn
$c = $this->processHashColor($color);
} elseif (preg_match('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\((.*?)\)/', $color, $m)) {
// quickfix for color containing CSS variable
preg_match('/var\(--([a-z-_]+)\)/i', $m[0], $var);
if ($var) {
// ignore colors containing CSS variables
if (str_starts_with(mb_strtolower($m[2]), 'var(--')) {
$m[2] = '0, 0, 0, 100';
}
$c = $this->processModeColor($m[1], explode(',', $m[2]));
Expand Down
4 changes: 2 additions & 2 deletions src/Mpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
use FpdiTrait;
use MpdfPsrLogAwareTrait;

const VERSION = '8.2.2';
const VERSION = '8.2.3';

const SCALE = 72 / 25.4;

Expand Down Expand Up @@ -13231,7 +13231,7 @@ function Footer()

/* -- WATERMARK -- */
if (($this->watermarkText) && ($this->showWatermarkText)) {
$this->watermark($this->watermarkText, $this->watermarkAngle, 120, $this->watermarkTextAlpha); // Watermark text
$this->watermark($this->watermarkText, $this->watermarkAngle, is_int($this->watermark_size) ? $this->watermark_size : 120, $this->watermarkTextAlpha); // Watermark text
}
if (($this->watermarkImage) && ($this->showWatermarkImage)) {
$this->watermarkImg($this->watermarkImage, $this->watermarkImageAlpha); // Watermark image
Expand Down
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
3 changes: 2 additions & 1 deletion src/Tag/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function open($attr, &$ahtml, &$ihtml)
$attr['VALUE'] = mb_convert_encoding($attr['VALUE'], $this->mpdf->mb_enc, 'UTF-8');
}
}
$this->mpdf->selectoption['currentVAL'] = $attr['VALUE'];

$this->mpdf->selectoption['currentVAL'] = isset($attr['VALUE']) ? $attr['VALUE'] : $ahtml[$ihtml + 1];
}

public function close(&$ahtml, &$ihtml)
Expand Down
24 changes: 24 additions & 0 deletions tests/Issues/Issue1934Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Issues;

use Mpdf\Tag\Option;
use Mpdf\Cache;
use Mpdf\CssManager;
use Mpdf\Form;
use Mpdf\Otl;
use Mpdf\TableOfContents;
use Mpdf\SizeConverter;
use Mpdf\Image\ImageProcessor;
use Mpdf\Language\LanguageToFontInterface;
use Mpdf\Color\ColorConverter;

class Issue1934Test extends \Mpdf\BaseMpdfTest
{
public function testWithFailingHtmlSnippet()
{
$html = '<select><option value="this option tag has the value">Option 1</option><option selected>Option 2</option></select>';

$this->mpdf->WriteHTML($html);
}
}
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 6f723a9

Please sign in to comment.