コード例 #1
0
ファイル: functions.app.php プロジェクト: Gradven/what3.1.7
function parse_link_callback($matches)
{
    if (preg_match('/^(?!http).*/i', $matches[1])) {
        $url = 'http://' . $matches[1];
    } else {
        $url = $matches[1];
    }
    if (is_inside_url($url)) {
        return '<a href="' . $url . '">' . FORMAT::sub_url($matches[1], 50) . '</a>';
    } else {
        return '<a href="' . $url . '" rel="nofollow" target="_blank">' . FORMAT::sub_url($matches[1], 50) . '</a>';
    }
}