thomascube
2011-12-22 c8c53f4ad1b4759841ab929eb4b3e770c5132eb1
Make emtpy/invalid links non-clickable

1 files modified
5 ■■■■■ changed files
program/steps/mail/func.inc 5 ●●●●● patch | view | raw | blame | history
program/steps/mail/func.inc
@@ -1231,6 +1231,7 @@
  $end = '>';
  // Remove non-printable characters in URL (#1487805)
  if ($attrib['href'])
  $attrib['href'] = preg_replace('/[\x00-\x1F]/', '', $attrib['href']);
  if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) {
@@ -1246,6 +1247,10 @@
      JS_OBJECT_NAME,
      JQ($mailto[1].$mailto[3]));
  }
  else if (empty($attrib['href']) && !$attrib['name']) {
    $attrib['href'] = './#NOP';
    $attrib['onclick'] = 'return false';
  }
  else if (!empty($attrib['href']) && $attrib['href'][0] != '#') {
    $attrib['target'] = '_blank';
  }