diff --git a/src/Plugin/Alipay/PreparePlugin.php b/src/Plugin/Alipay/PreparePlugin.php index b7df836..8f9f52b 100644 --- a/src/Plugin/Alipay/PreparePlugin.php +++ b/src/Plugin/Alipay/PreparePlugin.php @@ -121,7 +121,7 @@ class PreparePlugin implements PluginInterface $exploded = explode('-----END CERTIFICATE-----', file_get_contents($path)); foreach ($exploded as $cert) { - if (empty($cert)) { + if (empty(trim($cert))) { continue; } diff --git a/tests/Cert/alipayRootCert.crt b/tests/Cert/alipayRootCert.crt index d370e5b..6bf33b6 100644 --- a/tests/Cert/alipayRootCert.crt +++ b/tests/Cert/alipayRootCert.crt @@ -85,4 +85,7 @@ UugDo9u8igJORYA+5ms0s5sCUySqbQ2R5z/GoceyI9LdxIVa1RjVX8pYOj8JFwtn DJN3ftSFvNMYwRuILKuqUYSHc2GPYiHVflDh5nDymCMOQFcFG3WsEuB+EYQPFgIU 1DHmdZcz7Llx8UOZXX2JupWCYzK1XhJb+r4hK5ncf/w8qGtYlmyJpxk3hr1TfUJX Yf4Zr0fJsGuv ------END CERTIFICATE----- \ No newline at end of file +-----END CERTIFICATE----- + + +