diff --git a/ecrire/inc/distant.php b/ecrire/inc/distant.php index a26ec61a64bc99e1caeef0fc079fffce73509cc7..c53ccf10070a6ec41d5367e04809f3e8c3e23073 100644 --- a/ecrire/inc/distant.php +++ b/ecrire/inc/distant.php @@ -451,6 +451,7 @@ function recuperer_url($url, $options = []) { $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; } + spip_log("recuperer_url " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG); // Ajout des en-têtes spécifiques si besoin $formatted_data = ''; @@ -557,7 +558,7 @@ function recuperer_url($url, $options = []) { $options['datas'] = ''; } } - spip_log("recuperer_url recommence " . $options['methode']. " sur $url", 'distant'); + spip_log("recuperer_url recommence " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG); return recuperer_url($url, $options); } elseif ($res['status'] !== 200) { @@ -577,6 +578,7 @@ function recuperer_url($url, $options = []) { // on ne veut que les entetes if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { + spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG); return $result; } @@ -620,6 +622,10 @@ function recuperer_url($url, $options = []) { $result['page'] = transcoder_page($result['page'], $result['headers']); } + $trace = json_decode(json_encode($result), true); + $trace['page'] = '...'; + spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG); + return $result; }