From d739fe2503bbf438c9168896a03abf1397df6f10 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 3 Nov 2017 05:07:19 +0000 Subject: [PATCH] Issue 3860: Enhanced support of "!" for forums --- include/auth_ejabberd.php | 2 +- include/bbcode.php | 14 +++++++------- js/acl.js | 8 ++++---- mod/network.php | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/auth_ejabberd.php b/include/auth_ejabberd.php index 14f5dcfe0c..58a7378e29 100755 --- a/include/auth_ejabberd.php +++ b/include/auth_ejabberd.php @@ -307,7 +307,7 @@ class exAuth { */ private function writeLog($sMessage) { if (is_resource($this->rLogFile)) - fwrite($this->rLogFile, date("r")." ".$sMessage."\n"); + fwrite($this->rLogFile, date("r")." ".getmypid()." ".$sMessage."\n"); } /** diff --git a/include/bbcode.php b/include/bbcode.php index a14e3ee8e9..ee740e18ca 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -940,17 +940,17 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa // Remove all hashtag addresses if ((!$tryoembed || $simplehtml) && !in_array($simplehtml, array(3, 7))) { - $Text = preg_replace("/([#@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text); + $Text = preg_replace("/([#@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text); } elseif ($simplehtml == 3) { - $Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", + $Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text); } elseif ($simplehtml == 7) { - $Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", + $Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text); } elseif (!$simplehtml) { - $Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", + $Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text); } @@ -962,13 +962,13 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa "[bookmark=$1]$2[/bookmark]", $Text); if (in_array($simplehtml, array(2, 6, 7, 8, 9))) { - $Text = preg_replace_callback("/([^#@])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", "bb_expand_links", $Text); - //$Text = preg_replace("/[^#@]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $Text); + $Text = preg_replace_callback("/([^#@!])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", "bb_expand_links", $Text); + //$Text = preg_replace("/[^#@!]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $Text); $Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", ' $2 [url]$1[/url]',$Text); } if ($simplehtml == 5) { - $Text = preg_replace("/[^#@]\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[url]$1[/url]', $Text); + $Text = preg_replace("/[^#@!]\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[url]$1[/url]', $Text); } // Perform URL Search diff --git a/js/acl.js b/js/acl.js index 1ed354bbfa..9a575729f6 100644 --- a/js/acl.js +++ b/js/acl.js @@ -50,9 +50,9 @@ ACL.prototype.remove_mention = function(id) { var addr = this.data[id].addr; if (addr != "") { - var searchText = "@" + addr + " "; + var searchText = "!" + addr + " "; } else { - var searchText = "@" + nick + "+" + id + " "; + var searchText = "!" + nick + "+" + id + " "; } var start = this.element.val().indexOf(searchText); @@ -71,9 +71,9 @@ ACL.prototype.add_mention = function(id) { var addr = this.data[id].addr; if (addr != "") { - var searchText = "@" + addr + " "; + var searchText = "!" + addr + " "; } else { - var searchText = "@" + nick + "+" + id + " "; + var searchText = "!" + nick + "+" + id + " "; } if (this.element.val().indexOf( searchText) >= 0 ) { diff --git a/mod/network.php b/mod/network.php index f79becd9d0..e09fdd8fec 100644 --- a/mod/network.php +++ b/mod/network.php @@ -577,9 +577,9 @@ function networkThreadedView(App $a, $update = 0) { $contact = dba::select('contact', array('addr', 'nick'), $condition, array('limit' => 1)); if (dbm::is_result($contact)) { if ($contact["addr"] != '') { - $content = "@".$contact["addr"]; + $content = "!".$contact["addr"]; } else { - $content = "@".$contact["nick"]."+".$cid; + $content = "!".$contact["nick"]."+".$cid; } } } -- 2.39.5