Skip to content

Commit

Permalink
Fixed non-static method convertCertToPem called statically; fixes #380
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Jan 30, 2018
1 parent 95af94d commit bdd7891
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions lib/WP_Auth0_Api_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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 );
}
}
2 changes: 1 addition & 1 deletion lib/WP_Auth0_LoginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

0 comments on commit bdd7891

Please sign in to comment.