Skip to content
Snippets Groups Projects
Commit 09dc4225 authored by Alexander Hass's avatar Alexander Hass
Browse files

Fix some notices and use status_message for error with 301

parent 22219247
No related branches found
No related tags found
No related merge requests found
......@@ -227,7 +227,10 @@ function _linkchecker_status_handling($link, $response) {
// what results in a database UPDATE failure. For more information, see
// http://drupal.org/node/371495.
// Workaround: ISO-8859-1 as source encoding may be wrong, but WFM.
if (!isset($response->error)) { $response->error = ''; }
if (!isset($response->status_message)) { $response->status_message = ''; }
$response->error = trim(drupal_convert_to_utf8($response->error, 'ISO-8859-1'));
$response->status_message = trim(drupal_convert_to_utf8($response->status_message, 'ISO-8859-1'));
// Make response object consistent with HTTPRL.
if ($response->code == 301 && !isset($response->redirect_code)) {
......@@ -236,7 +239,7 @@ function _linkchecker_status_handling($link, $response) {
switch ($response->code) {
case 301:
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);
db_query("UPDATE {linkchecker_links} SET code = %d, error = '%s', fail_count = fail_count+1, last_checked = %d WHERE lid = %d", $response->code, $response->status_message, time(), $link->lid);
// A HTTP status code of 301 tells us an existing link have changed to
// a new link. The remote site owner was so kind to provide us the new
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment