Browse Source

Lorsqu’une page retourne une fatale, on arrête de chercher ce site à un moment donné.

svn/root
marcimat@rezo.net 2 years ago
parent
commit
0afc991a5c
2 changed files with 13 additions and 2 deletions
  1. +1
    -1
      genie/univers_check.php
  2. +12
    -1
      inc/univers_analyser.php

+ 1
- 1
genie/univers_check.php View File

@ -70,7 +70,7 @@ function genie_univers_check_dist($t) {
sql_updateq(
'spip_websites',
array('statut'=>'poub'),
"statut IN ('prop','publie') AND status='dead' AND retry>=10"
"statut IN ('prop','publie') AND status IN ('dead','fatal') AND retry>=10"
);
return 0;


+ 12
- 1
inc/univers_analyser.php View File

@ -225,6 +225,13 @@ function univers_analyser($url, $debug = false) {
// else record the page size and so on
$res['size'] = strlen($page);
$res['response'] = true;
if (
false !== stripos($page, 'Fatal error')
and false !== stripos($page, 'Call to undefined function')
) {
$res['response'] = 'fatal';
}
if (preg_match(',<title>(.*)</title>,Uims', $page, $r)) {
$res['title'] = $r[1];
}
@ -266,7 +273,11 @@ function univers_analyser_un($row, $debug = false) {
if ($res===false) {
$set['retry'] = ++$row['retry'];
$set['status'] = 'no-dns';
} elseif ($res['response']===false or $res['response']==='404') {
} elseif (
$res['response']===false
or $res['response']==='404'
or $res['response']==='fatal'
) {
$set['ip'] = $res['ip'];
$set['retry'] = ++$row['retry'];
$set['status'] = ($res['response']?$res['response']:'dead');


Loading…
Cancel
Save