5 * Redirect interface to linkchecker functionalities.
9 * Implements hook_redirect_insert().
11 function linkchecker_redirect_insert($redirect) {
12 linkchecker_redirect_update($redirect);
16 * Implements hook_redirect_update().
18 function linkchecker_redirect_update($redirect) {
19 // It's unknown if this is a redirect for HTTP/HTTPS or the encoded urls.
20 $url_http = url($redirect->source, array('absolute' => TRUE, $redirect->source_options));
21 $url_https = url($redirect->source, array('absolute' => TRUE, 'https' => TRUE, $redirect->source_options));
26 rawurldecode($url_http),
27 rawurldecode($url_https),
30 _linkchecker_redirect_reset($urls);
34 * Reset last_checked status.
37 * An array of urls that should be checked on next cron run.
39 function _linkchecker_redirect_reset($urls = array()) {
40 $urls = array_unique($urls);
42 $num_updated = db_update('linkchecker_link')
43 ->condition('urlhash', array_map('drupal_hash_base64', $urls))
44 ->condition('fail_count', 0, '>')
45 ->condition('status', 1)
46 ->fields(array('last_checked' => 0))
50 drupal_set_message(t('The link %url will be checked again on the next cron run.', array('%url' => $urls[0])));