MDL-58489 core: Fix unreachable HTTP error handling
authorJan Dageförde <jan.dagefoerde@ercis.uni-muenster.de>
Tue, 4 Apr 2017 19:02:51 +0000 (21:02 +0200)
committerJan Dageförde <jan.dagefoerde@ercis.uni-muenster.de>
Fri, 7 Apr 2017 07:50:15 +0000 (09:50 +0200)
lib/classes/oauth2/client.php
lib/oauthlib.php

index 5f2b8c2..d5bc03d 100644 (file)
@@ -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');
         }
 
index c684c9c..1fe80f5 100644 (file)
@@ -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');
         }