diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/acl.js | 18 | ||||
-rw-r--r-- | include/bb2diaspora.php | 6 | ||||
-rw-r--r-- | include/bbcode.php | 5 | ||||
-rw-r--r-- | include/text.php | 3 |
4 files changed, 22 insertions, 10 deletions
diff --git a/include/acl.js b/include/acl.js index 82b631ee9..ba6c6af73 100644 --- a/include/acl.js +++ b/include/acl.js @@ -58,7 +58,9 @@ ACL.prototype.on_search = function(event){ } ACL.prototype.on_showall = function(event){ + event.preventDefault() event.stopPropagation(); + if (that.showall.hasClass("selected")){ return false; } @@ -69,12 +71,14 @@ ACL.prototype.on_showall = function(event){ that.deny_cid = []; that.deny_gid = []; - that.updateview(); + that.update_view(); return false; } ACL.prototype.on_button_show = function(event){ + event.preventDefault() + event.stopImmediatePropagation() event.stopPropagation(); /*that.showall.removeClass("selected"); @@ -86,6 +90,8 @@ ACL.prototype.on_button_show = function(event){ return false; } ACL.prototype.on_button_hide = function(event){ + event.preventDefault() + event.stopImmediatePropagation() event.stopPropagation(); /*that.showall.removeClass("selected"); @@ -118,7 +124,7 @@ ACL.prototype.set_allow = function(itemid){ if (that.deny_cid.indexOf(id)>=0) that.deny_cid.remove(id); break; } - that.updateview(); + that.update_view(); } ACL.prototype.set_deny = function(itemid){ @@ -142,10 +148,10 @@ ACL.prototype.set_deny = function(itemid){ if (that.allow_cid.indexOf(id)>=0) that.allow_cid.remove(id); break; } - that.updateview(); + that.update_view(); } -ACL.prototype.updateview = function(){ +ACL.prototype.update_view = function(){ if (that.allow_gid.length==0 && that.allow_cid.length==0 && that.deny_gid.length==0 && that.deny_cid.length==0){ that.showall.addClass("selected"); @@ -153,7 +159,7 @@ ACL.prototype.updateview = function(){ $('#jot-perms-icon').removeClass('lock').addClass('unlock'); $('#jot-public').show(); $('.profile-jot-net input').attr('disabled', false); - if(editor != false) { + if(typeof editor != 'undefined' && editor != false) { $('#profile-jot-desc').html(ispublic); } @@ -235,6 +241,6 @@ ACL.prototype.populate = function(data){ //console.log(html); that.list_content.append(html); }); - that.updateview(); + that.update_view(); } diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 591aaf7fa..5b240bdd2 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -42,6 +42,8 @@ function stripdcode_br_cb($s) { function bb2diaspora($Text,$preserve_nl = false) { + $ev = bbtoevent($Text); + // Replace any html brackets with HTML Entities to prevent executing HTML or script // Don't use strip_tags here because it breaks [url] search by replacing & with amp @@ -52,7 +54,6 @@ function bb2diaspora($Text,$preserve_nl = false) { // After we're finished processing the bbcode we'll // replace all of the event code with a reformatted version. - $ev = bbtoevent($Text); if($preserve_nl) $Text = str_replace(array("\n","\r"), array('',''),$Text); @@ -185,7 +186,10 @@ function bb2diaspora($Text,$preserve_nl = false) { $Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",'',$Text); } + $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text); + $Text = preg_replace('/\[(.*?)\\\\_(.*?)\]\((.*?)\)/ism','[$1_$2]($3)',$Text); + $Text = preg_replace('/\[(.*?)\\\\\*(.*?)\]\((.*?)\)/ism','[$1*$2]($3)',$Text); call_hooks('bb2diaspora',$Text); 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)=(.*?)\&\;(.*?)\>/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)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$s); return($s); }} |