@@ -541,16 +541,21 @@ function _linkchecker_status_handling($link, $response) {
break;
case405:
case500:
// - 405: Special error handling if method is not allowed. Switch link
// checking to GET method and try again.
// - 500: Like WGET, try with GET on "500 Internal server error".
db_query("UPDATE {linkchecker_links} SET method = '%s' WHERE lid = %d",'GET',$link->lid);
db_query("UPDATE {linkchecker_links} SET method = '%s', code = %d, error = '%s', fail_count = fail_count+1, last_checked = %d WHERE lid = %d",'GET',$response->code,$response->error,time(),$link->lid);
watchdog('linkchecker','Method HEAD is not allowed for link %link. Method has been changed to GET.',array('%link'=>$link->url),WATCHDOG_INFO,l(t('Broken links'),'admin/reports/linkchecker'));
break;
if($response->code==405){
watchdog('linkchecker','Method HEAD is not allowed for link %link. Method has been changed to GET.',array('%link'=>$link->url),WATCHDOG_INFO,l(t('Broken links'),'admin/reports/linkchecker'));
case500:
// - 500: Like WGET, try with GET on "500 Internal server error".
// - If GET also fails with status code 500, than the link is broken.
if($link->method=='GET'&&$response->code==500){
db_query("UPDATE {linkchecker_links} SET code = %d, error = '%s', fail_count = fail_count+1, last_checked = %d WHERE lid = %d",$response->code,$response->error,time(),$link->lid);
watchdog('linkchecker','Broken link %link has been found.',array('%link'=>$link->url),WATCHDOG_NOTICE,l(t('Broken links'),'admin/reports/linkchecker'));
}
elseif($response->code==500){
else{
db_query("UPDATE {linkchecker_links} SET method = '%s', code = %d, error = '%s', fail_count = fail_count+1, last_checked = %d WHERE lid = %d",'GET',$response->code,$response->error,time(),$link->lid);
watchdog('linkchecker','Internal server error for link %link. Method has been changed to GET.',array('%link'=>$link->url),WATCHDOG_INFO,l(t('Broken links'),'admin/reports/linkchecker'));