Curl Response Refactoring

- refactored Network::getCurl()
- replaced every Network::getCur() execution with a Curl Response
This commit is contained in:
Philipp Holzer 2018-10-10 21:20:30 +02:00
parent 7c73e8634c
commit ffbc688797
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
9 changed files with 30 additions and 30 deletions

View file

@ -345,20 +345,20 @@ class Install extends BaseObject
$help = "";
$error_msg = "";
if (function_exists('curl_init')) {
$test = Network::fetchUrlFull(System::baseUrl() . "/install/testrewrite");
$fetchResult = Network::fetchUrlFull(System::baseUrl() . "/install/testrewrite");
$url = normalise_link(System::baseUrl() . "/install/testrewrite");
if ($test['body'] != "ok") {
$test = Network::fetchUrlFull($url);
if ($fetchResult->getBody() != "ok") {
$fetchResult = Network::fetchUrlFull($url);
}
if ($test['body'] != "ok") {
if ($fetchResult->getBody() != "ok") {
$status = false;
$help = L10n::t('Url rewrite in .htaccess is not working. Check your server configuration.');
$error_msg = [];
$error_msg['head'] = L10n::t('Error message from Curl when fetching');
$error_msg['url'] = $test['redirect_url'];
$error_msg['msg'] = defaults($test, 'error', '');
$error_msg['url'] = $fetchResult->getRedirectUrl();
$error_msg['msg'] = $fetchResult->getError();
}
self::addCheck($checks, L10n::t('Url rewrite is working'), $status, true, $help, $error_msg);
} else {