In public/private keys, force the header to be on its own line, allow missing \n after the footer

This commit is contained in:
Ron Arts 2018-01-04 12:17:31 +01:00
parent 91d9c11fb4
commit ef8a741527

View File

@ -14,7 +14,7 @@ namespace League\OAuth2\Server;
class CryptKey class CryptKey
{ {
const RSA_KEY_PATTERN = const RSA_KEY_PATTERN =
'/^(-----BEGIN (RSA )?(PUBLIC|PRIVATE) KEY-----).+(-----END (RSA )?(PUBLIC|PRIVATE) KEY-----)\s*$/s'; '/^(-----BEGIN (RSA )?(PUBLIC|PRIVATE) KEY-----)\R.*(-----END (RSA )?(PUBLIC|PRIVATE) KEY-----)\R?$/s';
/** /**
* @var string * @var string