From eb4ab7c4b8b485010d7f592f6d5c0d90f5ae71f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dagef=C3=B6rde?= Date: Tue, 4 Apr 2017 21:02:51 +0200 Subject: [PATCH] MDL-58489 core: Fix unreachable HTTP error handling --- lib/classes/oauth2/client.php | 2 +- lib/oauthlib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/classes/oauth2/client.php b/lib/classes/oauth2/client.php index 5f2b8c2870a..d5bc03d0ce8 100644 --- a/lib/classes/oauth2/client.php +++ b/lib/classes/oauth2/client.php @@ -188,7 +188,7 @@ class client extends \oauth2_client { $response = $this->post($this->token_url(), $this->build_post_data($params)); } - if (!$this->info['http_code'] === 200) { + if ($this->info['http_code'] !== 200) { throw new moodle_exception('Could not upgrade oauth token'); } diff --git a/lib/oauthlib.php b/lib/oauthlib.php index c684c9c911a..1fe80f52329 100644 --- a/lib/oauthlib.php +++ b/lib/oauthlib.php @@ -551,7 +551,7 @@ abstract class oauth2_client extends curl { $response = $this->post($this->token_url(), $this->build_post_data($params)); } - if (!$this->info['http_code'] === 200) { + if ($this->info['http_code'] !== 200) { throw new moodle_exception('Could not upgrade oauth token'); } -- 2.43.0