You are here

function _simplenews_statistics_parse_links in Simplenews Statistics 6.3

Same name and namespace in other branches
  1. 7.2 simplenews_statistics.module \_simplenews_statistics_parse_links()
  2. 7 simplenews_statistics.module \_simplenews_statistics_parse_links()

Parse links in the body.

1 call to _simplenews_statistics_parse_links()
simplenews_statistics_mail_alter in ./simplenews_statistics.module
Implements hook_mail_alter().

File

./simplenews_statistics.module, line 146
Main simplenews statistics file.

Code

function _simplenews_statistics_parse_links(&$body, $nid, $mail) {
  if (is_array($body)) {
    foreach ($body as $key => $element) {
      _simplenews_statistics_parse_links($body[$key], $nid, $mail);
    }
  }
  else {

    // Replace links.
    $pattern = '/(<a[^>]+href=")([^"]*)/emi';
    $body = preg_replace($pattern, '"\\1"._simplenews_statistics_replace_url("\\2", $nid, $mail)', $body);
  }
}