Skip to content

Commit

Permalink
Make regexp more strict and refuse trailing newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Nov 19, 2024
1 parent da04391 commit 6e13445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Key/PrivateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static function fromFile(
): static {
if (preg_match(PEM::PEM_REGEX, $file) !== 1) {
// Not a PEM-encoded key. Must be a file
if (preg_match('/^(file:\/\/)/i', $file) !== 1) {
if (preg_match('/^(file:\/\/)/Di', $file) !== 1) {
$file = preg_filter('/^/', 'file://', $file);
}
}
Expand Down

0 comments on commit 6e13445

Please sign in to comment.