14 * Example: {$foo|http}
15 * @author Andreas Gohr <gohr@cosmocode.de>
19 function smarty_modifier_http($string){
20 if(!$string) return '';
22 list($url,$name) = explode(' ',$string,2);
25 if(!parse_url($url, PHP_URL_SCHEME)) {
26 $url = 'http://' . $url;
29 if(!$name) $name = $url;
31 return '<a href="'.htmlspecialchars($url).'" target="_blank">'.htmlspecialchars($name).'</a>';
34 /* vim: set expandtab: */