aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-14 20:47:49 -0700
committerFriendika <info@friendika.com>2011-09-14 20:47:49 -0700
commit1778e4a315dd386911d12513d6aa7dc569782f13 (patch)
tree48724c299e8ad4d6b7ad021c5599cdc50270f60d /include
parent58b2bb58486a79e6725db8ed6153d8f4ab08cf21 (diff)
downloadvolse-hubzilla-1778e4a315dd386911d12513d6aa7dc569782f13.tar.gz
volse-hubzilla-1778e4a315dd386911d12513d6aa7dc569782f13.tar.bz2
volse-hubzilla-1778e4a315dd386911d12513d6aa7dc569782f13.zip
bloody ampersands
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php5
-rw-r--r--include/text.php3
2 files changed, 5 insertions, 3 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index af6c10c44..3886af37d 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -43,7 +43,7 @@ function bbcode($Text,$preserve_nl = false) {
// Perform URL Search
- $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\%\$\!\+\,]+)/", '$1<a href="$2" target="external-link">$2</a>', $Text);
+ $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/", '$1<a href="$2" target="external-link">$2</a>', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/m", '<a href="$1" target="external-link">$1</a>', $Text);
$Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/m", '<a href="$1" target="external-link">$2</a>', $Text);
@@ -159,7 +159,8 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);
}
-
+ // fix any escaped ampersands that may have been converted into links
+ $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
call_hooks('bbcode',$Text);
diff --git a/include/text.php b/include/text.php
index 2d65b681d..501121c80 100644
--- a/include/text.php
+++ b/include/text.php
@@ -635,7 +635,8 @@ function valid_email($x){
if(! function_exists('linkify')) {
function linkify($s) {
- $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="external-link">$1</a>', $s);
+ $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="external-link">$1</a>', $s);
+ $s = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$s);
return($s);
}}