diff options
author | Meitar Moscovitz <meitarm@gmail.com> | 2009-02-18 13:01:52 +1100 |
---|---|---|
committer | Meitar Moscovitz <meitarm@gmail.com> | 2009-02-18 13:01:52 +1100 |
commit | cca1d777485d9b5f41bbc65ad10b002702f0aae4 (patch) | |
tree | 1a498462a0d98d4f89a55f548099abd5401dc538 /lib/util.php | |
parent | 9d81cef5cc2a0a197a0223206ba3d9a687065886 (diff) | |
parent | 6fb3923cef0699a05b336f35505637485f16157e (diff) |
Merge branch 'dev-0.7.x' into framebusting
Conflicts:
lib/action.php
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php index b065c2d74..46aa7b9df 100644 --- a/lib/util.php +++ b/lib/util.php @@ -474,12 +474,18 @@ function common_replace_urls_callback($text, $callback) { function common_linkify($url) { // It comes in special'd, so we unspecial it before passing to the stringifying // functions + $ext = pathinfo($url, PATHINFO_EXTENSION); $url = htmlspecialchars_decode($url); + $video_ext = array('mp4', 'flv', 'avi', 'mpg', 'mp3', 'ogg'); $display = $url; $url = (!preg_match('#^([a-z]+://|(mailto|aim|tel):)#i', $url)) ? 'http://'.$url : $url; $attrs = array('href' => $url, 'rel' => 'external'); + if (in_array($ext, $video_ext)) { + $attrs['class'] = 'media'; + } + if ($longurl = common_longurl($url)) { $attrs['title'] = $longurl; } @@ -590,7 +596,7 @@ function common_tag_link($tag) $xs->element('a', array('href' => $url, 'rel' => 'tag'), $tag); - $xs->elementEnd(); + $xs->elementEnd('span'); return $xs->getString(); } |