Skip to content

Commit 55e5642

Browse files
committed
Update dependencies
1 parent 316bdc5 commit 55e5642

File tree

7 files changed

+34
-8
lines changed

7 files changed

+34
-8
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.6
1+
2.6.7

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"require-dev": {
3333
"pdepend/pdepend": "2.16.2",
3434
"phpmd/phpmd": "2.15.0",
35-
"phpunit/phpunit": "12.0.1 || 11.5.7 || 10.5.40",
36-
"squizlabs/php_codesniffer": "3.11.3"
35+
"phpunit/phpunit": "12.1.3 || 11.5.7 || 10.5.40",
36+
"squizlabs/php_codesniffer": "3.12.2"
3737
},
3838
"autoload": {
3939
"psr-4": {

resources/debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Vcs-Git: https://github.com/~#VENDOR#~/~#PROJECT#~.git
1010
Package: ~#PKGNAME#~
1111
Provides: php-~#PROJECT#~
1212
Architecture: all
13-
Depends: php (>= 8.1.0), php-json, php-zip, php-tecnickcom-tc-lib-file (<< 3.0.0), php-tecnickcom-tc-lib-file (>= 2.1.3), php-tecnickcom-tc-lib-unicode-data (<< 3.0.0), php-tecnickcom-tc-lib-unicode-data (>= 2.0.19), php-tecnickcom-tc-lib-pdf-encrypt (<< 3.0.0), php-tecnickcom-tc-lib-pdf-encrypt (>= 2.1.11), php-tecnickcom-tc-lib-pdf-font-core (<< 2.0.0), php-tecnickcom-tc-lib-pdf-font-data-core (>= 1.8.7), ${misc:Depends}
13+
Depends: php (>= 8.1.0), php-json, php-zip, php-tecnickcom-tc-lib-file (<< 3.0.0), php-tecnickcom-tc-lib-file (>= 2.1.4), php-tecnickcom-tc-lib-unicode-data (<< 3.0.0), php-tecnickcom-tc-lib-unicode-data (>= 2.0.20), php-tecnickcom-tc-lib-pdf-encrypt (<< 3.0.0), php-tecnickcom-tc-lib-pdf-encrypt (>= 2.1.12), php-tecnickcom-tc-lib-pdf-font-core (<< 2.0.0), php-tecnickcom-tc-lib-pdf-font-data-core (>= 1.8.7), ${misc:Depends}
1414
Description: PHP PDF Fonts Library
1515
PHP library containing PDF font methods and utilities.

resources/rpm/rpm.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Requires: php-json
2121
Requires: php-pcre
2222
Requires: php-zlib
2323
Requires: php-composer(%{c_vendor}/tc-lib-file) < 3.0.0
24-
Requires: php-composer(%{c_vendor}/tc-lib-file) >= 2.1.3
24+
Requires: php-composer(%{c_vendor}/tc-lib-file) >= 2.1.4
2525
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) < 3.0.0
26-
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) >= 2.0.19
26+
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) >= 2.0.20
2727
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) < 3.0.0
28-
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) >= 2.1.11
28+
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) >= 2.1.12
2929
Requires: php-composer(%{c_vendor}/tc-lib-pdf-font-data-core) < 2.0.0
3030
Requires: php-composer(%{c_vendor}/tc-lib-pdf-font-data-core) >= 1.8.7
3131

src/Font.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
namespace Com\Tecnick\Pdf\Font;
1818

1919
use Com\Tecnick\Pdf\Font\Exception as FontException;
20+
use Com\Tecnick\File\File;
2021

2122
/**
2223
* Com\Tecnick\Pdf\Font\Font
@@ -97,6 +98,10 @@ public function __construct(
9798
throw new FontException('empty font family name');
9899
}
99100

101+
if (FILE::hasDoubleDots($ifile) || FILE::hasForbiddenProtocol($ifile)) {
102+
throw new FontException('Invalid font ifile: ' . $ifile);
103+
}
104+
100105
$this->data['ifile'] = $ifile;
101106
$this->data['family'] = $font;
102107
$this->data['unicode'] = $unicode;

src/Import.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ public function __construct(
218218
int $encoding_id = 1,
219219
bool $linked = false
220220
) {
221+
if (FILE::hasDoubleDots($file) || FILE::hasForbiddenProtocol($file)) {
222+
throw new FontException('Invalid font file name: ' . $file);
223+
}
224+
221225
$this->fdt['input_file'] = $file;
222226
$this->fdt['file_name'] = $this->makeFontName($file);
223227
if (empty($this->fdt['file_name'])) {
@@ -450,7 +454,12 @@ protected function makeFontName(string $font_file): string
450454
*/
451455
protected function findOutputPath(string $output_path = ''): string
452456
{
453-
if ($output_path !== '' && is_writable($output_path)) {
457+
if (
458+
$output_path !== ''
459+
&& (strpos($output_path, '://') === false)
460+
&& !FILE::hasDoubleDots($output_path)
461+
&& is_writable($output_path)
462+
) {
454463
return $output_path;
455464
}
456465

test/ImportTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
*/
3434
class ImportTest extends TestUtil
3535
{
36+
public function testImportForbiddenProtocol(): void
37+
{
38+
$this->bcExpectException('\\' . \Com\Tecnick\Pdf\Font\Exception::class);
39+
new \Com\Tecnick\Pdf\Font\Import('phar://test.txt');
40+
}
41+
42+
public function testImportParentDir(): void
43+
{
44+
$this->bcExpectException('\\' . \Com\Tecnick\Pdf\Font\Exception::class);
45+
new \Com\Tecnick\Pdf\Font\Import('/tmp/something/../test.txt');
46+
}
47+
3648
public function testImportEmptyName(): void
3749
{
3850
$this->bcExpectException('\\' . \Com\Tecnick\Pdf\Font\Exception::class);

0 commit comments

Comments
 (0)