Skip to content

Commit

Permalink
Fix certificate_pem validtion rule to also work with 76 character lin…
Browse files Browse the repository at this point in the history
…es of base64
  • Loading branch information
uphlewis committed Oct 31, 2024
1 parent 5467d1b commit b008dd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Laravel/Validation/Rules/CertificatePem.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CertificatePem
* Inspired by @link https://regex101.com/r/mGnr7I/1
*/
public const PATTERN = '/^(-----BEGIN (PUBLIC KEY|(RSA )?PRIVATE KEY|CERTIFICATE)-----(\n|\r|\r\n)' // header
. '([0-9a-zA-Z\+\/=]{64}(\n|\r|\r\n))*([0-9a-zA-Z\+\/=]{1,63}(\n|\r|\r\n))?' // content
. '([0-9a-zA-Z\+\/=]{64,76}(\n|\r|\r\n))*([0-9a-zA-Z\+\/=]{1,76}(\n|\r|\r\n))?' // content
. '-----END (PUBLIC KEY|(RSA )?PRIVATE KEY|CERTIFICATE)-----(\n|\r|\r\n)?)+$/'; // footer

/**
Expand Down

0 comments on commit b008dd1

Please sign in to comment.