Commit 9e63698f authored by Simon Welsh's avatar Simon Welsh

And handle a bit more

git-svn-id: svn+ssh://lsgn/var/logbot-www@32 5f99df0c-6b0a-442a-b40a-040688e84a9d
parent 83e92e63
......@@ -161,7 +161,7 @@ function build_dates() {
}
function linkify($string) {
$pattern = '\b(https?://[^\s()<>"\'/]+|(?:[^\s()<>"\'.;/]+\.)+([\pL]{2,4}))(/[^\s<>()"\'/\?]*|/([^\s<>"\'/\?]*\([^\s<>()"\'/\?]*\)[^\s<>"\'/\?]*)+)*(\?[^\s<>()"\']*)?';
$pattern = '\b(https?://[^\s()<>"\'/]+|(?:[^\s()<>"\'.;/]+\.)+([\pL]{2,4}))(/[^\s<>()"\'/\?]*|/([^\s<>"\'/\?]*\([^\s<>()"\'/\?]*\)[^\s<>"\'/\?]*)+|\b)+(\?[^\s<>()"\']*)?';
return preg_replace_callback("#$pattern#ix", function($matches) use($string) {
$input = $matches[0];
if(isset($matches[2]) && empty($matches[3]) && in_array(strtolower($matches[2]), ['php', 'yml', 'yaml', 'ss', 'xml', 'jpg', 'png', 'gif', 'jpeg', 'form', 'log', 'lock', 'json', 'main'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment