Changeset e5af2fe in github


Ignore:
Timestamp:
Sep 19, 2008 1:11:22 PM (5 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
466c6ee
Parents:
a3f149e
Message:

Create valid <a> tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/steps/mail/func.inc

    r44385fd6 re5af2fe  
    978978 */ 
    979979function rcmail_alter_html_link($tag, $attrs, $container_id) 
    980   { 
     980{ 
    981981  $attrib = parse_attrib_string($attrs); 
    982  
    983   if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) 
     982  $end = '>'; 
     983 
     984  if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) { 
    984985    $attrib['href'] = "./bin/modcss.php?u=" . urlencode($attrib['href']) . "&amp;c=" . urlencode($container_id); 
    985  
    986   else if (stristr((string)$attrib['href'], 'mailto:')) 
     986    $end = ' />'; 
     987  } 
     988  else if (stristr((string)$attrib['href'], 'mailto:')) { 
    987989    $attrib['onclick'] = sprintf( 
    988990      "return %s.command('compose','%s',this)", 
    989991      JS_OBJECT_NAME, 
    990992      JQ(substr($attrib['href'], 7))); 
    991  
    992   else if (!empty($attrib['href']) && $attrib['href']{0}!='#') 
     993  } 
     994  else if (!empty($attrib['href']) && $attrib['href'][0] != '#') { 
    993995    $attrib['target'] = '_blank'; 
    994  
    995   return "<$tag" . create_attrib_string($attrib, array('href','name','target','onclick','id','class','style','title','rel','type','media')) . ' />'; 
    996   } 
     996  } 
     997 
     998  return "<$tag" . html::attrib_string($attrib, array('href','name','target','onclick','id','class','style','title','rel','type','media')) . $end; 
     999} 
    9971000 
    9981001 
Note: See TracChangeset for help on using the changeset viewer.