Skip to content

Instantly share code, notes, and snippets.

@boonebgorges
Created March 15, 2024 17:12
Show Gist options
  • Save boonebgorges/f7b35550e1b3318aee8335d4f034366d to your computer and use it in GitHub Desktop.
Save boonebgorges/f7b35550e1b3318aee8335d4f034366d to your computer and use it in GitHub Desktop.
dk-pdf PHP 8+ patch
commit 4587312ae27de3c37ddfbe05bcf2ef448b9f0e7b
Author: Boone B Gorges <[email protected]>
Date: Wed Jan 4 12:02:21 2023 -0600
PHP compat for dk-pdf.
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code128.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code128.php
index 4e1e2122cd..f3fa8e46f3 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code128.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code128.php
@@ -172,7 +172,7 @@ class Code128 extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Bar
$newCode = '';
$hclen = (strlen($code) / 2);
for ($i = 0; $i < $hclen; ++$i) {
- $newCode .= chr((int) ($code{(2 * $i)} . $code{(2 * $i + 1)}));
+ $newCode .= chr((int) ($code[ (2 * $i) ] . $code[ (2 * $i + 1) ]));
}
$code = $newCode;
break;
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code93.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code93.php
index 4be240f04c..690ab86f53 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code93.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Code93.php
@@ -119,10 +119,10 @@ class Code93 extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
$clen = strlen($code);
for ($i = 0; $i < $clen; ++$i) {
- if (ord($code{$i}) > 127) {
- throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid character "%s" in Code93 barcode value', $code{$i}));
+ if (ord($code[ $i ]) > 127) {
+ throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid character "%s" in Code93 barcode value', $code[ $i ]));
}
- $code_ext .= $encode[$code{$i}];
+ $code_ext .= $encode[$code[ $i ]];
}
// checksum
@@ -135,7 +135,7 @@ class Code93 extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
$clen = strlen($code);
for ($i = 0; $i < $clen; ++$i) {
- $char = ord($code{$i});
+ $char = ord($code[ $i ]);
if (!isset($chr[$char])) {
// invalid character
throw new \Mpdf\Barcode\BarcodeException('Invalid CODE93 barcode value');
@@ -146,7 +146,7 @@ class Code93 extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
} else {
$t = false; // space
}
- $w = $chr[$char]{$j};
+ $w = $chr[$char][ $j ];
$bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0];
$bararray['maxw'] += $w;
++$k;
@@ -183,7 +183,7 @@ class Code93 extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
$p = 1;
$check = 0;
for ($i = ($len - 1); $i >= 0; --$i) {
- $k = array_keys($chars, $code{$i});
+ $k = array_keys($chars, $code[ $i ]);
$check += ($k[0] * $p);
++$p;
if ($p > 20) {
@@ -198,7 +198,7 @@ class Code93 extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
$p = 1;
$check = 0;
for ($i = $len; $i >= 0; --$i) {
- $k = array_keys($chars, $code{$i});
+ $k = array_keys($chars, $code[ $i ]);
$check += ($k[0] * $p);
++$p;
if ($p > 15) {
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanExt.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanExt.php
index 65afb7183d..353bc0ccc1 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanExt.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanExt.php
@@ -43,7 +43,7 @@ class EanExt extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
if ($length == 2) {
$r = $code % 4;
} elseif ($length == 5) {
- $r = (3 * ($code{0} + $code{2} + $code{4})) + (9 * ($code{1} + $code{3}));
+ $r = (3 * ($code[ 0 ] + $code[ 2 ] + $code[ 4 ])) + (9 * ($code[ 1 ] + $code[ 3 ]));
$r %= 10;
} else {
throw new \Mpdf\Barcode\BarcodeException('Invalid EAN barcode value');
@@ -95,7 +95,7 @@ class EanExt extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
];
$p = $parities[$length][$r];
$seq = '1011'; // left guard bar
- $seq .= $codes[$p[0]][$code{0}];
+ $seq .= $codes[$p[0]][$code[ 0 ]];
for ($i = 1; $i < $length; ++$i) {
$seq .= '01'; // separator
$seq .= $codes[$p[$i]][$code[$i]];
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanUpc.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanUpc.php
index aabf8e959a..5a7395062a 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanUpc.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/EanUpc.php
@@ -209,7 +209,7 @@ class EanUpc extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
if ($upce && isset($upceCode)) {
$bararray = ['code' => $upceCode, 'maxw' => 0, 'maxh' => 1, 'bcode' => []];
- $p = $upceParities[$code{1}][$r];
+ $p = $upceParities[$code[ 1 ]][$r];
for ($i = 0; $i < 6; ++$i) {
$seq .= $codes[$p[$i]][$upceCode[$i]];
}
@@ -222,7 +222,7 @@ class EanUpc extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barc
$seq .= $codes['A'][$code[$i]];
}
} else {
- $p = $parities[$code{0}];
+ $p = $parities[$code[ 0 ]];
for ($i = 1; $i < $halfLen; ++$i) {
$seq .= $codes[$p[$i - 1]][$code[$i]];
}
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Imb.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Imb.php
index 71756bf847..8c77e8f100 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Imb.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Barcode/Imb.php
@@ -112,9 +112,9 @@ class Imb extends \Mpdf\Barcode\AbstractBarcode implements \Mpdf\Barcode\Barcode
}
$binaryCode = bcmul($binaryCode, 10);
- $binaryCode = bcadd($binaryCode, $trackingNumber{0});
+ $binaryCode = bcadd($binaryCode, $trackingNumber[ 0 ]);
$binaryCode = bcmul($binaryCode, 5);
- $binaryCode = bcadd($binaryCode, $trackingNumber{1});
+ $binaryCode = bcadd($binaryCode, $trackingNumber[ 1 ]);
$binaryCode .= substr($trackingNumber, 2, 18);
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Color/ColorConverter.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Color/ColorConverter.php
index 3fc0dc8863..0eeb2bda8a 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Color/ColorConverter.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Color/ColorConverter.php
@@ -66,15 +66,15 @@ class ColorConverter
{
$this->ensureBinaryColorFormat($c);
- if ($c{0} == static::MODE_RGB || $c{0} == static::MODE_RGBA) {
- list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c{1}) / 255, ord($c{2}) / 255, ord($c{3}) / 255);
+ if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) {
+ list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c[1]) / 255, ord($c[2]) / 255, ord($c[3]) / 255);
$l += ((1 - $l) * 0.8);
list($r, $g, $b) = $this->colorModeConverter->hsl2rgb($h, $s, $l);
$ret = [3, $r, $g, $b];
- } elseif ($c{0} == static::MODE_CMYK || $c{0} == static::MODE_CMYKA) {
- $ret = [4, max(0, ord($c{1}) - 20), max(0, ord($c{2}) - 20), max(0, ord($c{3}) - 20), max(0, ord($c{4}) - 20)];
- } elseif ($c{0} == static::MODE_GRAYSCALE) {
- $ret = [1, min(255, ord($c{1}) + 32)];
+ } elseif ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) {
+ $ret = [4, max(0, ord($c[1]) - 20), max(0, ord($c[2]) - 20), max(0, ord($c[3]) - 20), max(0, ord($c[4]) - 20)];
+ } elseif ($c[0] == static::MODE_GRAYSCALE) {
+ $ret = [1, min(255, ord($c[1]) + 32)];
}
$c = array_pad($ret, 6, 0);
@@ -87,16 +87,16 @@ class ColorConverter
{
$this->ensureBinaryColorFormat($c);
- if ($c{0} == static::MODE_RGB || $c{0} == static::MODE_RGBA) {
- list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c{1}) / 255, ord($c{2}) / 255, ord($c{3}) / 255);
+ if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) {
+ list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c[1]) / 255, ord($c[2]) / 255, ord($c[3]) / 255);
$s *= 0.25;
$l *= 0.75;
list($r, $g, $b) = $this->colorModeConverter->hsl2rgb($h, $s, $l);
$ret = [3, $r, $g, $b];
- } elseif ($c{0} == static::MODE_CMYK || $c{0} == static::MODE_CMYKA) {
- $ret = [4, min(100, ord($c{1}) + 20), min(100, ord($c{2}) + 20), min(100, ord($c{3}) + 20), min(100, ord($c{4}) + 20)];
- } elseif ($c{0} == static::MODE_GRAYSCALE) {
- $ret = [1, max(0, ord($c{1}) - 32)];
+ } elseif ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) {
+ $ret = [4, min(100, ord($c[1]) + 20), min(100, ord($c[2]) + 20), min(100, ord($c[3]) + 20), min(100, ord($c[4]) + 20)];
+ } elseif ($c[0] == static::MODE_GRAYSCALE) {
+ $ret = [1, max(0, ord($c[1]) - 32)];
}
$c = array_pad($ret, 6, 0);
$cstr = pack('a1ccccc', $c[0], $c[1] & 0xFF, $c[2] & 0xFF, $c[3] & 0xFF, $c[4] & 0xFF, $c[5] & 0xFF);
@@ -112,16 +112,16 @@ class ColorConverter
{
$this->ensureBinaryColorFormat($c);
- if ($c{0} == static::MODE_RGB || $c{0} == static::MODE_RGBA) {
- return [3, 255 - ord($c{1}), 255 - ord($c{2}), 255 - ord($c{3})];
+ if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) {
+ return [3, 255 - ord($c[1]), 255 - ord($c[2]), 255 - ord($c[3])];
}
- if ($c{0} == static::MODE_CMYK || $c{0} == static::MODE_CMYKA) {
- return [4, 100 - ord($c{1}), 100 - ord($c{2}), 100 - ord($c{3}), 100 - ord($c{4})];
+ if ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) {
+ return [4, 100 - ord($c[1]), 100 - ord($c[2]), 100 - ord($c[3]), 100 - ord($c[4])];
}
- if ($c{0} == static::MODE_GRAYSCALE) {
- return [1, 255 - ord($c{1})];
+ if ($c[0] == static::MODE_GRAYSCALE) {
+ return [1, 255 - ord($c[1])];
}
// Cannot cope with non-RGB colors at present
@@ -135,28 +135,28 @@ class ColorConverter
*/
public function colAtoString($c)
{
- if ($c{0} == static::MODE_GRAYSCALE) {
- return 'rgb(' . ord($c{1}) . ', ' . ord($c{1}) . ', ' . ord($c{1}) . ')';
+ if ($c[0] == static::MODE_GRAYSCALE) {
+ return 'rgb(' . ord($c[1]) . ', ' . ord($c[1]) . ', ' . ord($c[1]) . ')';
}
- if ($c{0} == static::MODE_SPOT) {
- return 'spot(' . ord($c{1}) . ', ' . ord($c{2}) . ')';
+ if ($c[0] == static::MODE_SPOT) {
+ return 'spot(' . ord($c[1]) . ', ' . ord($c[2]) . ')';
}
- if ($c{0} == static::MODE_RGB) {
- return 'rgb(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ')';
+ if ($c[0] == static::MODE_RGB) {
+ return 'rgb(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ')';
}
- if ($c{0} == static::MODE_CMYK) {
- return 'cmyk(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ', ' . ord($c{4}) . ')';
+ if ($c[0] == static::MODE_CMYK) {
+ return 'cmyk(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . ord($c[4]) . ')';
}
- if ($c{0} == static::MODE_RGBA) {
- return 'rgba(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ', ' . sprintf('%0.2F', ord($c{4}) / 100) . ')';
+ if ($c[0] == static::MODE_RGBA) {
+ return 'rgba(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . sprintf('%0.2F', ord($c[4]) / 100) . ')';
}
- if ($c{0} == static::MODE_CMYKA) {
- return 'cmyka(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ', ' . ord($c{4}) . ', ' . sprintf('%0.2F', ord($c{5}) / 100) . ')';
+ if ($c[0] == static::MODE_CMYKA) {
+ return 'cmyka(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . ord($c[4]) . ', ' . sprintf('%0.2F', ord($c[5]) / 100) . ')';
}
return '';
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gif/ImageHeader.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gif/ImageHeader.php
index 0717a9360b..35429419cc 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gif/ImageHeader.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gif/ImageHeader.php
@@ -62,7 +62,7 @@ class ImageHeader
return false;
}
- $b = ord($lpData{8});
+ $b = ord($lpData[ 8 ]);
$this->m_bLocalClr = ($b & 0x80) ? true : false;
$this->m_bInterlace = ($b & 0x40) ? true : false;
$this->m_bSorted = ($b & 0x20) ? true : false;
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gradient.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gradient.php
index fd288c10d6..8f7300b962 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gradient.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Gradient.php
@@ -509,11 +509,11 @@ class Gradient
for ($i = 0; $i < count($stops); $i++) {
// mPDF 5.3.74
if ($colorspace === 'CMYK') {
- $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F %.3F', ord($stops[$i]['col']{1}) / 100, ord($stops[$i]['col']{2}) / 100, ord($stops[$i]['col']{3}) / 100, ord($stops[$i]['col']{4}) / 100);
+ $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F %.3F', ord($stops[$i]['col'][1]) / 100, ord($stops[$i]['col'][2]) / 100, ord($stops[$i]['col'][3]) / 100, ord($stops[$i]['col'][4]) / 100);
} elseif ($colorspace === 'Gray') {
- $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F', ord($stops[$i]['col']{1}) / 255);
+ $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F', ord($stops[$i]['col'][1]) / 255);
} else {
- $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F', ord($stops[$i]['col']{1}) / 255, ord($stops[$i]['col']{2}) / 255, ord($stops[$i]['col']{3}) / 255);
+ $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F', ord($stops[$i]['col'][1]) / 255, ord($stops[$i]['col'][2]) / 255, ord($stops[$i]['col'][3]) / 255);
}
if (!isset($stops[$i]['opacity'])) {
$stops[$i]['opacity'] = 1;
@@ -704,9 +704,9 @@ class Gradient
if (!$col) {
$col = $this->colorConverter->convert(255, $this->mpdf->PDFAXwarnings);
}
- if ($col{0} == 1) {
+ if ($col[ 0 ] == 1) {
$g['colorspace'] = 'Gray';
- } elseif ($col{0} == 4 || $col{0} == 6) {
+ } elseif ($col[ 0 ] == 4 || $col[ 0 ] == 6) {
$g['colorspace'] = 'CMYK';
}
@@ -848,9 +848,9 @@ class Gradient
if (!$col) {
$col = $this->colorConverter->convert(255, $this->mpdf->PDFAXwarnings);
}
- if ($col{0} == 1) {
+ if ($col[0] == 1) {
$g['colorspace'] = 'Gray';
- } elseif ($col{0} == 4 || $col{0} == 6) {
+ } elseif ($col[0] == 4 || $col[0] == 6) {
$g['colorspace'] = 'CMYK';
}
$g['stops'][] = $this->getStop($col, $el);
@@ -864,15 +864,15 @@ class Gradient
'col' => $col,
];
- if ($col{0} == 5) {
+ if ($col[0] == 5) {
// transparency from rgba()
- $stop['opacity'] = ord($col{4}) / 100;
- } elseif ($col{0} == 6) {
+ $stop['opacity'] = ord($col[4]) / 100;
+ } elseif ($col[0] == 6) {
// transparency from cmyka()
- $stop['opacity'] = ord($col{5}) / 100;
- } elseif ($col{0} == 1 && $col{2} == 1) {
+ $stop['opacity'] = ord($col[5]) / 100;
+ } elseif ($col[0] == 1 && $col[2] == 1) {
// transparency converted from rgba or cmyka()
- $stop['opacity'] = ord($col{3}) / 100;
+ $stop['opacity'] = ord($col[3]) / 100;
}
if (isset($el[1])) {
@@ -942,9 +942,9 @@ class Gradient
$g['colorspace'] = 'RGB';
// mPDF 5.3.74
$cor = $this->colorConverter->convert($bgr[1], $this->mpdf->PDFAXwarnings);
- if ($cor{0} == 1) {
+ if ($cor[0] == 1) {
$g['colorspace'] = 'Gray';
- } elseif ($cor{0} == 4 || $cor{0} == 6) {
+ } elseif ($cor[0] == 4 || $cor[0] == 6) {
$g['colorspace'] = 'CMYK';
}
if ($cor) {
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/ImageProcessor.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/ImageProcessor.php
index 29fb58b6df..bdf25eaa51 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/ImageProcessor.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/ImageProcessor.php
@@ -531,7 +531,7 @@ class ImageProcessor
if ($colorindex >= $n) {
$alpha = 255;
} else {
- $alpha = ord($transparency{$colorindex});
+ $alpha = ord($transparency[ $colorindex ]);
} // 0-255
if ($alpha > 0) {
imagesetpixel($imgalpha, $xpx, $ypx, $alpha);
@@ -1039,7 +1039,7 @@ class ImageProcessor
if ($colorindex >= $n) {
$alpha = 255;
} else {
- $alpha = ord($transparency{$colorindex});
+ $alpha = ord($transparency[ $colorindex ]);
} // 0-255
$mimgdata .= chr($alpha);
}
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/Svg.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/Svg.php
index e127a6782e..86b3f94c56 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/Svg.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Image/Svg.php
@@ -1368,11 +1368,11 @@ class Svg
else if (strtolower($critere_style['fill']) == 'currentcolor' && $element != 'line') {
$col = $this->colorConverter->convert($critere_style['color'], $this->mpdf->PDFAXwarnings);
if ($col) {
- if ($col{0} == 5) {
- $critere_style['fill-opacity'] = ord($col{4} / 100);
+ if ($col[ 0 ] == 5) {
+ $critere_style['fill-opacity'] = ord($col[ 4 ] / 100);
} // RGBa
- if ($col{0} == 6) {
- $critere_style['fill-opacity'] = ord($col{5} / 100);
+ if ($col[ 0 ] == 6) {
+ $critere_style['fill-opacity'] = ord($col[ 5 ] / 100);
} // CMYKa
$path_style .= $this->mpdf->SetFColor($col, true) . ' ';
$style .= 'F';
@@ -1380,11 +1380,11 @@ class Svg
} else if ($critere_style['fill'] != 'none' && $element != 'line') {
$col = $this->colorConverter->convert($critere_style['fill'], $this->mpdf->PDFAXwarnings);
if ($col) {
- if ($col{0} == 5) {
- $critere_style['fill-opacity'] = ord($col{4} / 100);
+ if ($col[ 0 ] == 5) {
+ $critere_style['fill-opacity'] = ord($col[ 4 ] / 100);
} // RGBa
- if ($col{0} == 6) {
- $critere_style['fill-opacity'] = ord($col{5} / 100);
+ if ($col[ 0 ] == 6) {
+ $critere_style['fill-opacity'] = ord($col[ 5 ] / 100);
} // CMYKa
$path_style .= $this->mpdf->SetFColor($col, true) . ' ';
$style .= 'F';
@@ -1409,11 +1409,11 @@ class Svg
else if (strtolower($critere_style['stroke']) == 'currentcolor') {
$col = $this->colorConverter->convert($critere_style['color'], $this->mpdf->PDFAXwarnings);
if ($col) {
- if ($col{0} == 5) {
- $critere_style['stroke-opacity'] = ord($col{4} / 100);
+ if ($col[ 0 ] == 5) {
+ $critere_style['stroke-opacity'] = ord($col[ 4 ] / 100);
} // RGBa
- if ($col{0} == 6) {
- $critere_style['stroke-opacity'] = ord($col{5} / 100);
+ if ($col[ 0 ] == 6) {
+ $critere_style['stroke-opacity'] = ord($col[ 5 ] / 100);
} // CMYKa
$path_style .= $this->mpdf->SetDColor($col, true) . ' ';
$style .= 'D';
@@ -1425,11 +1425,11 @@ class Svg
if ($col) {
// mPDF 5.0.051
// mPDF 5.3.74
- if ($col{0} == 5) {
- $critere_style['stroke-opacity'] = ord($col{4} / 100);
+ if ($col[ 0 ] == 5) {
+ $critere_style['stroke-opacity'] = ord($col[ 4 ] / 100);
} // RGBa
- if ($col{0} == 6) {
- $critere_style['stroke-opacity'] = ord($col{5} / 100);
+ if ($col[ 0 ] == 6) {
+ $critere_style['stroke-opacity'] = ord($col[ 5 ] / 100);
} // CMYKa
$path_style .= $this->mpdf->SetDColor($col, true) . ' ';
$style .= 'D';
@@ -3261,14 +3261,14 @@ class Svg
if (!$col) {
$col = $this->colorConverter->convert('#000000', $this->mpdf->PDFAXwarnings);
} // In case "transparent" or "inherit" returned
- if ($col{0} == 3 || $col{0} == 5) { // RGB
- $color_final = sprintf('%.3F %.3F %.3F', ord($col{1}) / 255, ord($col{2}) / 255, ord($col{3}) / 255);
+ if ($col[ 0 ] == 3 || $col[ 0 ] == 5) { // RGB
+ $color_final = sprintf('%.3F %.3F %.3F', ord($col[ 1 ]) / 255, ord($col[ 2 ]) / 255, ord($col[ 3 ]) / 255);
$this->svg_gradient[$last_gradid]['colorspace'] = 'RGB';
- } else if ($col{0} == 4 || $col{0} == 6) { // CMYK
- $color_final = sprintf('%.3F %.3F %.3F %.3F', ord($col{1}) / 100, ord($col{2}) / 100, ord($col{3}) / 100, ord($col{4}) / 100);
+ } else if ($col[ 0 ] == 4 || $col[ 0 ] == 6) { // CMYK
+ $color_final = sprintf('%.3F %.3F %.3F %.3F', ord($col[ 1 ]) / 100, ord($col[ 2 ]) / 100, ord($col[ 3 ]) / 100, ord($col[ 4 ]) / 100);
$this->svg_gradient[$last_gradid]['colorspace'] = 'CMYK';
- } else if ($col{0} == 1) { // Grayscale
- $color_final = sprintf('%.3F', ord($col{1}) / 255);
+ } else if ($col[0] == 1) { // Grayscale
+ $color_final = sprintf('%.3F', ord($col[1]) / 255);
$this->svg_gradient[$last_gradid]['colorspace'] = 'Gray';
}
@@ -3277,10 +3277,10 @@ class Svg
$stop_opacity = $m[1];
} else if (isset($attribs['stop-opacity'])) {
$stop_opacity = $attribs['stop-opacity'];
- } else if ($col{0} == 5) { // RGBa
- $stop_opacity = ord($col{4} / 100);
- } else if ($col{0} == 6) { // CMYKa
- $stop_opacity = ord($col{5} / 100);
+ } else if ($col[0] == 5) { // RGBa
+ $stop_opacity = ord($col[4] / 100);
+ } else if ($col[0] == 6) { // CMYKa
+ $stop_opacity = ord($col[5] / 100);
}
$tmp_color = [
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Mpdf.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Mpdf.php
index 67642b4856..dd4d7da9a8 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Mpdf.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Mpdf.php
@@ -2206,10 +2206,10 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
if ($this->bodyBackgroundColor) {
$s .= 'q ' . $this->SetFColor($this->bodyBackgroundColor, true) . "\n";
- if ($this->bodyBackgroundColor{0} == 5) { // RGBa
- $s .= $this->SetAlpha(ord($this->bodyBackgroundColor{4}) / 100, 'Normal', true, 'F') . "\n";
- } elseif ($this->bodyBackgroundColor{0} == 6) { // CMYKa
- $s .= $this->SetAlpha(ord($this->bodyBackgroundColor{5}) / 100, 'Normal', true, 'F') . "\n";
+ if ($this->bodyBackgroundColor[0] == 5) { // RGBa
+ $s .= $this->SetAlpha(ord($this->bodyBackgroundColor[4]) / 100, 'Normal', true, 'F') . "\n";
+ } elseif ($this->bodyBackgroundColor[0] == 6) { // CMYKa
+ $s .= $this->SetAlpha(ord($this->bodyBackgroundColor[5]) / 100, 'Normal', true, 'F') . "\n";
}
$s .= sprintf('%.3F %.3F %.3F %.3F re f Q', ($clx * Mpdf::SCALE), ($cly * Mpdf::SCALE), $clw * Mpdf::SCALE, $clh * Mpdf::SCALE) . "\n";
}
@@ -2287,10 +2287,10 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
$s .= $pb['clippath'] . "\n";
}
$s .= 'q ' . $this->SetFColor($pb['col'], true) . "\n";
- if ($pb['col']{0} == 5) { // RGBa
- $s .= $this->SetAlpha(ord($pb['col']{4}) / 100, 'Normal', true, 'F') . "\n";
- } elseif ($pb['col']{0} == 6) { // CMYKa
- $s .= $this->SetAlpha(ord($pb['col']{5}) / 100, 'Normal', true, 'F') . "\n";
+ if ($pb['col'][0] == 5) { // RGBa
+ $s .= $this->SetAlpha(ord($pb['col'][4]) / 100, 'Normal', true, 'F') . "\n";
+ } elseif ($pb['col'][0] == 6) { // CMYKa
+ $s .= $this->SetAlpha(ord($pb['col'][5]) / 100, 'Normal', true, 'F') . "\n";
}
$s .= sprintf('%.3F %.3F %.3F %.3F re f Q', $pb['x'] * Mpdf::SCALE, ($this->h - $pb['y']) * Mpdf::SCALE, $pb['w'] * Mpdf::SCALE, -$pb['h'] * Mpdf::SCALE) . "\n";
if (isset($pb['clippath']) && $pb['clippath']) {
@@ -2498,10 +2498,10 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
foreach ($pbs as $pb) {
if ((!isset($pb['gradient']) || !$pb['gradient']) && (!isset($pb['image_id']) || !$pb['image_id'])) {
$s .= 'q ' . $this->SetFColor($pb['col'], true) . "\n";
- if ($pb['col']{0} == 5) { // RGBa
- $s .= $this->SetAlpha(ord($pb['col']{4}) / 100, 'Normal', true, 'F') . "\n";
- } elseif ($pb['col']{0} == 6) { // CMYKa
- $s .= $this->SetAlpha(ord($pb['col']{5}) / 100, 'Normal', true, 'F') . "\n";
+ if ($pb['col'][0] == 5) { // RGBa
+ $s .= $this->SetAlpha(ord($pb['col'][4]) / 100, 'Normal', true, 'F') . "\n";
+ } elseif ($pb['col'][ 0 ] == 6) { // CMYKa
+ $s .= $this->SetAlpha(ord($pb['col'][5]) / 100, 'Normal', true, 'F') . "\n";
}
$s .= sprintf('%.3F %.3F %.3F %.3F re %s Q', $pb['x'] * Mpdf::SCALE, ($this->h - $pb['y']) * Mpdf::SCALE, $pb['w'] * Mpdf::SCALE, -$pb['h'] * Mpdf::SCALE, 'f') . "\n";
}
@@ -3254,14 +3254,14 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
if (!$col) {
return '';
} // mPDF 6
- if ($col{0} == 3 || $col{0} == 5) { // RGB / RGBa
- $out = sprintf('%.3F %.3F %.3F rg', ord($col{1}) / 255, ord($col{2}) / 255, ord($col{3}) / 255);
- } elseif ($col{0} == 1) { // GRAYSCALE
- $out = sprintf('%.3F g', ord($col{1}) / 255);
- } elseif ($col{0} == 2) { // SPOT COLOR
- $out = sprintf('/CS%d cs %.3F scn', ord($col{1}), ord($col{2}) / 100);
- } elseif ($col{0} == 4 || $col{0} == 6) { // CMYK / CMYKa
- $out = sprintf('%.3F %.3F %.3F %.3F k', ord($col{1}) / 100, ord($col{2}) / 100, ord($col{3}) / 100, ord($col{4}) / 100);
+ if ($col[ 0 ] == 3 || $col[ 0 ] == 5) { // RGB / RGBa
+ $out = sprintf('%.3F %.3F %.3F rg', ord($col[ 1 ]) / 255, ord($col[ 2 ]) / 255, ord($col[ 3 ]) / 255);
+ } elseif ($col[ 0 ] == 1) { // GRAYSCALE
+ $out = sprintf('%.3F g', ord($col[ 1 ]) / 255);
+ } elseif ($col[ 0 ] == 2) { // SPOT COLOR
+ $out = sprintf('/CS%d cs %.3F scn', ord($col[ 1 ]), ord($col[ 2 ]) / 100);
+ } elseif ($col[ 0 ] == 4 || $col[ 0 ] == 6) { // CMYK / CMYKa
+ $out = sprintf('%.3F %.3F %.3F %.3F k', ord($col[ 1 ]) / 100, ord($col[ 2 ]) / 100, ord($col[ 3 ]) / 100, ord($col[ 4 ]) / 100);
}
if ($type == 'Draw') {
$out = strtoupper($out);
@@ -4550,7 +4550,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
for ($c = 0; $c < count($cOTLdata); $c++) {
for ($i = 0; $i < strlen($cOTLdata[$c]['group']); $i++) {
- if ($cOTLdata[$c]['group']{$i} == 'S') {
+ if ($cOTLdata[$c]['group'][ $i ] == 'S') {
// Save from last word
if ($max_kashida_in_word) {
$k_ctr++;
@@ -5229,12 +5229,12 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
foreach ($this->textshadow as $ts) {
$s .= ' q ';
$s .= $this->SetTColor($ts['col'], true) . "\n";
- if ($ts['col']{0} == 5 && ord($ts['col']{4}) < 100) { // RGBa
- $s .= $this->SetAlpha(ord($ts['col']{4}) / 100, 'Normal', true, 'F') . "\n";
- } elseif ($ts['col']{0} == 6 && ord($ts['col']{5}) < 100) { // CMYKa
- $s .= $this->SetAlpha(ord($ts['col']{5}) / 100, 'Normal', true, 'F') . "\n";
- } elseif ($ts['col']{0} == 1 && $ts['col']{2} == 1 && ord($ts['col']{3}) < 100) { // Gray
- $s .= $this->SetAlpha(ord($ts['col']{3}) / 100, 'Normal', true, 'F') . "\n";
+ if ($ts['col'][ 0 ] == 5 && ord($ts['col'][ 4 ]) < 100) { // RGBa
+ $s .= $this->SetAlpha(ord($ts['col'][ 4 ]) / 100, 'Normal', true, 'F') . "\n";
+ } elseif ($ts['col'][ 0 ] == 6 && ord($ts['col'][ 5 ]) < 100) { // CMYKa
+ $s .= $this->SetAlpha(ord($ts['col'][ 5 ]) / 100, 'Normal', true, 'F') . "\n";
+ } elseif ($ts['col'][ 0 ] == 1 && $ts['col'][ 2 ] == 1 && ord($ts['col'][ 3 ]) < 100) { // Gray
+ $s .= $this->SetAlpha(ord($ts['col'][ 3 ]) / 100, 'Normal', true, 'F') . "\n";
}
$s .= sprintf(' 1 0 0 1 %.4F %.4F cm', $ts['x'] * Mpdf::SCALE, -$ts['y'] * Mpdf::SCALE) . "\n";
$s .= $sub;
@@ -5516,7 +5516,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
// Get YPlacement from next Base character
$nextbase = $i + 1;
- while ($OTLdata['group']{$nextbase} != 'C') {
+ while ($OTLdata['group'][ $nextbase ] != 'C') {
$nextbase++;
}
if (isset($GPOSinfo[$nextbase]) && isset($GPOSinfo[$nextbase]['YPlacement']) && $GPOSinfo[$nextbase]['YPlacement']) {
@@ -9977,12 +9977,12 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
$annotcolor = ' /C [';
if (isset($pl['opt']['c']) and $pl['opt']['c']) {
$col = $pl['opt']['c'];
- if ($col{0} == 3 || $col{0} == 5) {
- $annotcolor .= sprintf("%.3F %.3F %.3F", ord($col{1}) / 255, ord($col{2}) / 255, ord($col{3}) / 255);
- } elseif ($col{0} == 1) {
- $annotcolor .= sprintf("%.3F", ord($col{1}) / 255);
- } elseif ($col{0} == 4 || $col{0} == 6) {
- $annotcolor .= sprintf("%.3F %.3F %.3F %.3F", ord($col{1}) / 100, ord($col{2}) / 100, ord($col{3}) / 100, ord($col{4}) / 100);
+ if ($col[ 0 ] == 3 || $col[ 0 ] == 5) {
+ $annotcolor .= sprintf("%.3F %.3F %.3F", ord($col[ 1 ]) / 255, ord($col[ 2 ]) / 255, ord($col[ 3 ]) / 255);
+ } elseif ($col[ 0 ] == 1) {
+ $annotcolor .= sprintf("%.3F", ord($col[ 1 ]) / 255);
+ } elseif ($col[ 0 ] == 4 || $col[ 0 ] == 6) {
+ $annotcolor .= sprintf("%.3F %.3F %.3F %.3F", ord($col[ 1 ]) / 100, ord($col[ 2 ]) / 100, ord($col[ 3 ]) / 100, ord($col[ 4 ]) / 100);
} else {
$annotcolor .= '1 1 0';
}
@@ -18724,23 +18724,23 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
if (isset($this->blk[$blvl]['box_shadow']) && $this->blk[$blvl]['box_shadow'] && $h > 0) {
foreach ($this->blk[$blvl]['box_shadow'] as $sh) {
// Colors
- if ($sh['col']{0} == 1) {
+ if ($sh['col'][ 0 ] == 1) {
$colspace = 'Gray';
- if ($sh['col']{2} == 1) {
+ if ($sh['col'][ 2 ] == 1) {
$col1 = '1' . $sh['col'][1] . '1' . $sh['col'][3];
} else {
$col1 = '1' . $sh['col'][1] . '1' . chr(100);
}
$col2 = '1' . $sh['col'][1] . '1' . chr(0);
- } elseif ($sh['col']{0} == 4) { // CMYK
+ } elseif ($sh['col'][ 0 ] == 4) { // CMYK
$colspace = 'CMYK';
$col1 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . chr(100);
$col2 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . chr(0);
- } elseif ($sh['col']{0} == 5) { // RGBa
+ } elseif ($sh['col'][ 0 ] == 5) { // RGBa
$colspace = 'RGB';
$col1 = '5' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4];
$col2 = '5' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . chr(0);
- } elseif ($sh['col']{0} == 6) { // CMYKa
+ } elseif ($sh['col'][ 0 ] == 6) { // CMYKa
$colspace = 'CMYK';
$col1 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . $sh['col'][5];
$col2 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . chr(0);
@@ -18770,12 +18770,12 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
// Set path for INNER shadow
$shadow .= ' q 0 w ';
$shadow .= $this->SetFColor($col1, true) . "\n";
- if ($col1{0} == 5 && ord($col1{4}) < 100) { // RGBa
- $shadow .= $this->SetAlpha(ord($col1{4}) / 100, 'Normal', true, 'F') . "\n";
- } elseif ($col1{0} == 6 && ord($col1{5}) < 100) { // CMYKa
- $shadow .= $this->SetAlpha(ord($col1{5}) / 100, 'Normal', true, 'F') . "\n";
- } elseif ($col1{0} == 1 && $col1{2} == 1 && ord($col1{3}) < 100) { // Gray
- $shadow .= $this->SetAlpha(ord($col1{3}) / 100, 'Normal', true, 'F') . "\n";
+ if ($col1[ 0 ] == 5 && ord($col1[ 4 ]) < 100) { // RGBa
+ $shadow .= $this->SetAlpha(ord($col1[ 4 ]) / 100, 'Normal', true, 'F') . "\n";
+ } elseif ($col1[ 0 ] == 6 && ord($col1[ 5 ]) < 100) { // CMYKa
+ $shadow .= $this->SetAlpha(ord($col1[ 5 ]) / 100, 'Normal', true, 'F') . "\n";
+ } elseif ($col1[ 0 ] == 1 && $col1[ 2 ] == 1 && ord($col1[ 3 ]) < 100) { // Gray
+ $shadow .= $this->SetAlpha(ord($col1[ 3 ]) / 100, 'Normal', true, 'F') . "\n";
}
// Blur edges
@@ -22197,8 +22197,8 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
// Precedence to darker colours at joins
$coldom = 0;
if (isset($details[$side]['c']) && is_array($details[$side]['c'])) {
- if ($details[$side]['c']{0} == 3) { // RGB
- $coldom = 10 - (((ord($details[$side]['c']{1}) * 1.00) + (ord($details[$side]['c']{2}) * 1.00) + (ord($details[$side]['c']{3}) * 1.00)) / 76.5);
+ if ($details[$side]['c'][ 0 ] == 3) { // RGB
+ $coldom = 10 - (((ord($details[$side]['c'][ 1 ]) * 1.00) + (ord($details[$side]['c'][ 2 ]) * 1.00) + (ord($details[$side]['c'][ 3 ]) * 1.00)) / 76.5);
}
} // 10 black - 0 white
if ($coldom) {
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Otl.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Otl.php
index 13c30e2afe..caed0daa28 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Otl.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Otl.php
@@ -3092,7 +3092,7 @@ class Otl
$ok = true;
$matches = [];
while ($ok) {
- $x = ord($dict{$dictptr});
+ $x = ord($dict[$dictptr]);
$c = $this->OTLdata[$ptr]['uni'] & 0xFF;
if ($x == static::_DICT_INTERMEDIATE_MATCH) {
//echo "DICT_INTERMEDIATE_MATCH: ".dechex($c).'<br />';
@@ -3111,11 +3111,11 @@ class Otl
} elseif ($x == static::_DICT_NODE_TYPE_LINEAR) {
//echo "DICT_NODE_TYPE_LINEAR: ".dechex($c).'<br />';
$dictptr++;
- $m = ord($dict{$dictptr});
+ $m = ord($dict[$dictptr]);
if ($c == $m) {
$ptr++;
if ($ptr > count($this->OTLdata) - 1) {
- $next = ord($dict{$dictptr + 1});
+ $next = ord($dict[$dictptr + 1]);
if ($next == static::_DICT_INTERMEDIATE_MATCH || $next == static::_DICT_FINAL_MATCH) {
// Do not match if next character in text is a Mark
if (isset($this->OTLdata[$ptr]['uni']) && strpos($this->GlyphClassMarks, $this->OTLdata[$ptr]['hex']) === false) {
@@ -3133,13 +3133,13 @@ class Otl
} elseif ($x == static::_DICT_NODE_TYPE_SPLIT) {
//echo "DICT_NODE_TYPE_SPLIT ON ".dechex($d).": ".dechex($c).'<br />';
$dictptr++;
- $d = ord($dict{$dictptr});
+ $d = ord($dict[$dictptr]);
if ($c < $d) {
$dictptr += 5;
} else {
$dictptr++;
// Unsigned long 32-bit offset
- $offset = (ord($dict{$dictptr}) * 16777216) + (ord($dict{$dictptr + 1}) << 16) + (ord($dict{$dictptr + 2}) << 8) + ord($dict{$dictptr + 3});
+ $offset = (ord($dict[$dictptr]) * 16777216) + (ord($dict[$dictptr + 1]) << 16) + (ord($dict[$dictptr + 2]) << 8) + ord($dict[$dictptr + 3]);
$dictptr = $offset;
}
} else {
@@ -4671,7 +4671,7 @@ class Otl
} else {
$gpos = '';
}
- $chardata[] = ['char' => $chunkOTLdata['char_data'][$i]['uni'], 'level' => $cel, 'type' => $chardir, 'group' => $chunkOTLdata['group']{$i}, 'GPOSinfo' => $gpos];
+ $chardata[] = ['char' => $chunkOTLdata['char_data'][$i]['uni'], 'level' => $cel, 'type' => $chardir, 'group' => $chunkOTLdata['group'][$i], 'GPOSinfo' => $gpos];
}
}
@@ -5581,7 +5581,7 @@ class Otl
if (isset($cOTLdata[$nc]['char_data'][$i]['orig_type'])) {
$carac['orig_type'] = $cOTLdata[$nc]['char_data'][$i]['orig_type'];
}
- $carac['group'] = $cOTLdata[$nc]['group']{$i};
+ $carac['group'] = $cOTLdata[$nc]['group'][$i];
$carac['chunkid'] = $chunkorder[$nc]; // gives font id and/or object ID
$maxlevel = max((isset($carac['level']) ? $carac['level'] : 0), $maxlevel);
diff --git a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Pdf/Protection.php b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Pdf/Protection.php
index bc0c155110..80477d0668 100644
--- a/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Pdf/Protection.php
+++ b/wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Pdf/Protection.php
@@ -270,7 +270,7 @@ class Protection
for ($i = 1; $i <= 19; ++$i) {
$key = '';
for ($j = 0; $j < $len; ++$j) {
- $key .= chr(ord($owner_rc4_key{$j}) ^ $i);
+ $key .= chr(ord($owner_rc4_key[ $j ]) ^ $i);
}
$enc = $this->rc4($key, $enc);
}
@@ -288,7 +288,7 @@ class Protection
for ($i = 1; $i <= 19; ++$i) {
$key = '';
for ($j = 0; $j < $len; ++$j) {
- $key .= chr(ord($this->encryptionKey{$j}) ^ $i);
+ $key .= chr(ord($this->encryptionKey[ $j ]) ^ $i);
}
$enc = $this->rc4($key, $enc);
}
@@ -352,7 +352,7 @@ class Protection
++$len;
}
for ($i = 0; $i < $len; $i += 2) {
- $s .= chr(hexdec($hs{$i} . $hs{($i + 1)}));
+ $s .= chr(hexdec($hs[ $i ] . $hs[ ($i + 1) ]));
}
return $s;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment