mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 07:15:13 +00:00
mod_ap_probe: return curl error info if fetch fails
This commit is contained in:
parent
009e457f36
commit
4327c7844c
2 changed files with 5 additions and 2 deletions
|
@ -73,7 +73,7 @@ class Activity {
|
|||
|
||||
|
||||
|
||||
static function fetch($url,$channel = null,$hub = null) {
|
||||
static function fetch($url,$channel = null,$hub = null,$debug = false) {
|
||||
$redirects = 0;
|
||||
if (! check_siteallowed($url)) {
|
||||
logger('denied: ' . $url);
|
||||
|
@ -165,6 +165,9 @@ class Activity {
|
|||
}
|
||||
else {
|
||||
logger('fetch failed: ' . $url);
|
||||
if ($debug) {
|
||||
return $x;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class Ap_probe extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
$x = Activity::fetch($resource,$channel);
|
||||
$x = Activity::fetch($resource,$channel,null,true);
|
||||
|
||||
if ($x) {
|
||||
$o .= '<pre>' . str_replace('\\n',"\n",htmlspecialchars(json_encode($x,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT))) . '</pre>';
|
||||
|
|
Loading…
Reference in a new issue