Merge pull request #1006 from MrPetovan/task/curl_DI

Introduce "HTTPRequest" class
This commit is contained in:
Michael Vogel 2020-07-25 09:50:01 +02:00 committed by GitHub
commit 2c69a9c359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 34 additions and 49 deletions

View file

@ -15,7 +15,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
function curweather_install()
@ -49,7 +48,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
}
try {
$res = new SimpleXMLElement(Network::fetchUrl($url));
$res = new SimpleXMLElement(DI::httpRequest()->fetch($url));
} catch (Exception $e) {
if (empty($_SESSION['curweather_notice_shown'])) {
notice(DI::l10n()->t('Error fetching weather data. Error was: ' . $e->getMessage()));