get rid of the need for allow_url_fopen

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-09 10:50:14 +01:00
parent 05b4c58aa8
commit 4d3fa6eca5
6 changed files with 254 additions and 192 deletions

View File

@@ -233,13 +233,8 @@ class lescript_v2
// simple self check
if (Settings::Get('system.disable_le_selfcheck') == '0') {
$selfcheckContextOptions = array(
'http' => array(
'header' => "User-Agent: Froxlor/" . $this->version
)
);
$selfcheckContext = stream_context_create($selfcheckContextOptions);
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
$selfcheckpayload = HttpClient::urlGet($uri);
if ($payload !== trim($selfcheckpayload)) {
$errmsg = json_encode(error_get_last());
if ($errmsg != "null") {
$errmsg = "; PHP error: " . $errmsg;