mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-17 14:18:35 +01:00
[contents] improve file_get_contents() reporting (#986)
Suppress any errors from file_get_contents() and include the PHP error in the feed instead.
This commit is contained in:
parent
ef4923ae5c
commit
245af35a60
@ -54,7 +54,7 @@ function getContents($url, $header = array(), $opts = array()){
|
||||
|
||||
// Use file_get_contents if in CLI mode with no root certificates defined
|
||||
if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) {
|
||||
$data = file_get_contents($url);
|
||||
$data = @file_get_contents($url);
|
||||
|
||||
if($data === false) {
|
||||
$errorCode = 500;
|
||||
@ -167,10 +167,14 @@ EOD
|
||||
);
|
||||
}
|
||||
|
||||
$lastError = error_get_last();
|
||||
if($lastError !== null)
|
||||
$lastError = $lastError['message'];
|
||||
returnError(<<<EOD
|
||||
The requested resource cannot be found!
|
||||
Please make sure your input parameters are correct!
|
||||
cUrl error: $curlError ($curlErrno)
|
||||
PHP error: $lastError
|
||||
EOD
|
||||
, $errorCode);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user