Skip to content

Commit 5d89aef

Browse files
committed
fix: create patcher for pdfparser
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent a41620f commit 5d89aef

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/Vendor/.gitkeep

Whitespace-only changes.

scoper.inc.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ static function (string $filePath, string $prefix, string $content): string {
7979
$content = str_replace("'phpseclib3\\\\", "'\\\\" . $s_prefix . '\\\\phpseclib3\\\\', $content);
8080
$content = str_replace("'\\\\phpseclib3", "'\\\\" . $s_prefix . '\\\\phpseclib3', $content);
8181
return $content;
82-
}
82+
},
83+
// patchers for pdfparser
84+
static function (string $filePath, string $prefix, string $content): string {
85+
if (!str_contains($filePath, 'smalot/pdfparser') || !str_ends_with($filePath, '.php')) {
86+
return $content;
87+
}
88+
$s_prefix = str_replace('\\', '\\\\', $prefix);
89+
$content = str_replace("'\\Smalot\\PdfParser", "'\\\\" . $s_prefix . '\\\\Smalot\\\\PdfParser\\\\', $content);
90+
return $content;
91+
},
8392
],
8493
];

0 commit comments

Comments
 (0)