diff options
author | Arno Richter <mail@arnorichter.de> | 2022-01-26 23:07:24 +0100 |
---|---|---|
committer | Arno Richter <mail@arnorichter.de> | 2022-01-26 23:07:24 +0100 |
commit | 8925294b3e72386a870e8eb730cd7ce32bd62a91 (patch) | |
tree | 9bcea3d74d7e2c897c291ae924f92d70466c3761 /functions.php | |
parent | 8acc282d4dece45a3b6db472b9f52f736c0203a4 (diff) | |
parent | a291fc85ba17cd06f6ab5e1890388ea74a7e5863 (diff) | |
download | microblog-8925294b3e72386a870e8eb730cd7ce32bd62a91.tar.gz microblog-8925294b3e72386a870e8eb730cd7ce32bd62a91.tar.bz2 microblog-8925294b3e72386a870e8eb730cd7ce32bd62a91.zip |
Clean up formatting after #9
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/functions.php b/functions.php index 9ff4de1..94b9dc1 100644 --- a/functions.php +++ b/functions.php @@ -6,17 +6,6 @@ function path($fragment=null) { return (!empty($config['path'][$fragment])) ? $config['path'][$fragment] : false; } -function autolink($text='') { - // https://stackoverflow.com/a/10002262/3625228 - $pattern = '(?xi)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))'; - - return preg_replace_callback("#$pattern#i", function($matches) { - $input = $matches[0]; - $url = preg_match('!^https?://!i', $input) ? $input : "http://$input"; - return '<a href="' . $url . '" data-external="true">' . "$input</a>"; - }, $text); -} - function db_insert($message, $timestamp=NOW) { global $db; if(empty($db)) return false; |