Browse Source

linkify naked urls when they are at the beginning of the text

pull/1/head
Friendika 12 years ago
parent
commit
6c0218563f
  1. 3
      include/bbcode.php

3
include/bbcode.php

@ -21,7 +21,8 @@ function bbcode($Text) {
// Perform URL Search
$Text = preg_replace("/[^\]\=](https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</a>', $Text);
$Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$2" >$2</a>', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" >$1</a>', $Text);
$Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" >$2</a>', $Text);

Loading…
Cancel
Save