From bdd78912a69a83a63d964005b13af118af556711 Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Tue, 30 Jan 2018 10:13:04 -0800 Subject: [PATCH] Fixed non-static method convertCertToPem called statically; fixes #380 --- lib/WP_Auth0_Api_Client.php | 16 ++++++++++++++-- lib/WP_Auth0_LoginManager.php | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/WP_Auth0_Api_Client.php b/lib/WP_Auth0_Api_Client.php index 3da56959..02968f61 100755 --- a/lib/WP_Auth0_Api_Client.php +++ b/lib/WP_Auth0_Api_Client.php @@ -1039,7 +1039,7 @@ public static function update_guardian($domain, $app_token, $factor, $enabled) { return json_decode($response['body']); } - protected function convertCertToPem($cert) { + protected static function convert_cert_to_pem( $cert ) { return '-----BEGIN CERTIFICATE-----'.PHP_EOL .chunk_split($cert, 64, PHP_EOL) .'-----END CERTIFICATE-----'.PHP_EOL; @@ -1076,7 +1076,7 @@ public static function JWKfetch($domain) { $jwks = json_decode($response['body'], true); foreach ($jwks['keys'] as $key) { - $secret[$key['kid']] = self::convertCertToPem($key['x5c'][0]); + $secret[$key['kid']] = self::convert_cert_to_pem($key['x5c'][0]); } if ($cache_expiration !== 0) { @@ -1102,4 +1102,16 @@ public static function get_client_grant_types() { 'client_credentials', ); } + + /** + * DEPRECATED 3.5.2 + * + * @param $cert + * + * @return string + */ + protected function convertCertToPem( $cert ) { + trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED ); + return self::convert_cert_to_pem( $cert ); + } } \ No newline at end of file diff --git a/lib/WP_Auth0_LoginManager.php b/lib/WP_Auth0_LoginManager.php index 0b0de1af..104261ae 100755 --- a/lib/WP_Auth0_LoginManager.php +++ b/lib/WP_Auth0_LoginManager.php @@ -544,7 +544,7 @@ protected function query_vars( $key ) { * @param $id_token */ private function dieWithVerifyEmail( $userinfo, $id_token = '' ) { - trigger_error( __( 'Method dieWithVerifyEmail is deprecated.', 'wp-auth0' ), E_USER_DEPRECATED); + trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED ); WP_Auth0_Email_Verification::render_die( $userinfo ); } } \ No newline at end of file