mirror of
https://github.com/friendica/friendica
synced 2024-12-22 21:08:07 +01:00
Make "HTTPRequest::fetchUrlFull" dynamic
This commit is contained in:
parent
8793096c16
commit
3b4cf87c95
4 changed files with 6 additions and 6 deletions
|
@ -126,7 +126,7 @@ function pubsubhubbub_init(App $a) {
|
||||||
$hub_callback = rtrim($hub_callback, ' ?&#');
|
$hub_callback = rtrim($hub_callback, ' ?&#');
|
||||||
$separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&';
|
$separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&';
|
||||||
|
|
||||||
$fetchResult = HTTPRequest::fetchUrlFull($hub_callback . $separator . $params);
|
$fetchResult = DI::httpRequest()->fetchUrlFull($hub_callback . $separator . $params);
|
||||||
$body = $fetchResult->getBody();
|
$body = $fetchResult->getBody();
|
||||||
$ret = $fetchResult->getReturnCode();
|
$ret = $fetchResult->getReturnCode();
|
||||||
|
|
||||||
|
|
|
@ -548,11 +548,11 @@ class Installer
|
||||||
$help = "";
|
$help = "";
|
||||||
$error_msg = "";
|
$error_msg = "";
|
||||||
if (function_exists('curl_init')) {
|
if (function_exists('curl_init')) {
|
||||||
$fetchResult = HTTPRequest::fetchUrlFull($baseurl . "/install/testrewrite");
|
$fetchResult = DI::httpRequest()->fetchUrlFull($baseurl . "/install/testrewrite");
|
||||||
|
|
||||||
$url = Strings::normaliseLink($baseurl . "/install/testrewrite");
|
$url = Strings::normaliseLink($baseurl . "/install/testrewrite");
|
||||||
if ($fetchResult->getReturnCode() != 204) {
|
if ($fetchResult->getReturnCode() != 204) {
|
||||||
$fetchResult = HTTPRequest::fetchUrlFull($url);
|
$fetchResult = DI::httpRequest()->fetchUrlFull($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($fetchResult->getReturnCode() != 204) {
|
if ($fetchResult->getReturnCode() != 204) {
|
||||||
|
|
|
@ -365,9 +365,9 @@ class HTTPRequest
|
||||||
* @return CurlResult With all relevant information, 'body' contains the actual fetched content.
|
* @return CurlResult With all relevant information, 'body' contains the actual fetched content.
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function fetchUrlFull(string $url, bool $binary = false, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
|
public function fetchUrlFull(string $url, bool $binary = false, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
|
||||||
{
|
{
|
||||||
return self::curl(
|
return $this->curl(
|
||||||
$url,
|
$url,
|
||||||
$binary,
|
$binary,
|
||||||
[
|
[
|
||||||
|
|
|
@ -103,7 +103,7 @@ class PortableContact
|
||||||
|
|
||||||
Logger::log('load: ' . $url, Logger::DEBUG);
|
Logger::log('load: ' . $url, Logger::DEBUG);
|
||||||
|
|
||||||
$fetchresult = HTTPRequest::fetchUrlFull($url);
|
$fetchresult = DI::httpRequest()->fetchUrlFull($url);
|
||||||
$s = $fetchresult->getBody();
|
$s = $fetchresult->getBody();
|
||||||
|
|
||||||
Logger::log('load: returns ' . $s, Logger::DATA);
|
Logger::log('load: returns ' . $s, Logger::DATA);
|
||||||
|
|
Loading…
Reference in a new issue