aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-01 21:13:09 -0800
committerFriendika <info@friendika.com>2010-12-01 21:13:09 -0800
commit42d66874bed88753cbcf08a060c89f789f41a3ae (patch)
treef8d79a930522b934797f83a3c10c0daf9b1262c9 /boot.php
parent1adf69a04967a3829749b99c8ce663d5068748dd (diff)
downloadvolse-hubzilla-42d66874bed88753cbcf08a060c89f789f41a3ae.tar.gz
volse-hubzilla-42d66874bed88753cbcf08a060c89f789f41a3ae.tar.bz2
volse-hubzilla-42d66874bed88753cbcf08a060c89f789f41a3ae.zip
improved linkification of naked text urls
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index d1e570d3b..66236f39d 100644
--- a/boot.php
+++ b/boot.php
@@ -1567,4 +1567,10 @@ function aes_encrypt($val,$ky)
$enc=MCRYPT_RIJNDAEL_128;
$val=str_pad($val, (16*(floor(strlen($val) / 16)+(strlen($val) % 16==0?2:1))), chr(16-(strlen($val) % 16)));
return mcrypt_encrypt($enc, $key, $val, $mode, mcrypt_create_iv( mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM));
-}} \ No newline at end of file
+}}
+
+if(! function_exists('linkify')) {
+function linkify($s) {
+ $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</a>', $s);
+ return($s);
+}} \ No newline at end of file