mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-71329 tool_moodlenet: Check to see if we get errors before curl
This commit is contained in:
parent
9600becce3
commit
37a80759ea
1 changed files with 1 additions and 2 deletions
|
@ -310,11 +310,10 @@ class profile_manager {
|
|||
'CURLOPT_HEADER' => 0,
|
||||
];
|
||||
$content = $curl->get($url, null, $options);
|
||||
$errno = $curl->get_errno();
|
||||
$info = $curl->get_info();
|
||||
|
||||
// The base cURL seems fine, let's press on.
|
||||
if (!$errno) {
|
||||
if (!$curl->get_errno() && !$curl->error) {
|
||||
// WebFinger gave us a 404 back so the user has no droids here.
|
||||
if ($info['http_code'] >= 400) {
|
||||
if ($info['http_code'] === 404) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue