Browse Source

Issue 3860: Enhanced support of "!" for forums

tags/3.6
Michael 1 year ago
parent
commit
d739fe2503
4 changed files with 14 additions and 14 deletions
  1. 1
    1
      include/auth_ejabberd.php
  2. 7
    7
      include/bbcode.php
  3. 4
    4
      js/acl.js
  4. 2
    2
      mod/network.php

+ 1
- 1
include/auth_ejabberd.php View File

@@ -307,7 +307,7 @@ class exAuth {
307 307
 	 */
308 308
 	private function writeLog($sMessage) {
309 309
 		if (is_resource($this->rLogFile))
310
-			fwrite($this->rLogFile, date("r")." ".$sMessage."\n");
310
+			fwrite($this->rLogFile, date("r")." ".getmypid()." ".$sMessage."\n");
311 311
 	}
312 312
 
313 313
 	/**

+ 7
- 7
include/bbcode.php View File

@@ -940,17 +940,17 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
940 940
 
941 941
 	// Remove all hashtag addresses
942 942
 	if ((!$tryoembed || $simplehtml) && !in_array($simplehtml, array(3, 7))) {
943
-		$Text = preg_replace("/([#@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text);
943
+		$Text = preg_replace("/([#@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text);
944 944
 	} elseif ($simplehtml == 3) {
945
-		$Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
945
+		$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
946 946
 			'$1<a href="$2">$3</a>',
947 947
 			$Text);
948 948
 	} elseif ($simplehtml == 7) {
949
-		$Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
949
+		$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
950 950
 			'$1<span class="vcard"><a href="$2" class="url" title="$3"><span class="fn nickname mention">$3</span></a></span>',
951 951
 			$Text);
952 952
 	} elseif (!$simplehtml) {
953
-		$Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
953
+		$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
954 954
 			'$1<a href="$2" class="userinfo mention" title="$3">$3</a>',
955 955
 			$Text);
956 956
 	}
@@ -962,13 +962,13 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
962 962
 				"[bookmark=$1]$2[/bookmark]", $Text);
963 963
 
964 964
 	if (in_array($simplehtml, array(2, 6, 7, 8, 9))) {
965
-		$Text = preg_replace_callback("/([^#@])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", "bb_expand_links", $Text);
966
-		//$Text = preg_replace("/[^#@]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $Text);
965
+		$Text = preg_replace_callback("/([^#@!])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", "bb_expand_links", $Text);
966
+		//$Text = preg_replace("/[^#@!]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $Text);
967 967
 		$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", ' $2 [url]$1[/url]',$Text);
968 968
 	}
969 969
 
970 970
 	if ($simplehtml == 5) {
971
-		$Text = preg_replace("/[^#@]\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[url]$1[/url]', $Text);
971
+		$Text = preg_replace("/[^#@!]\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[url]$1[/url]', $Text);
972 972
 	}
973 973
 
974 974
 	// Perform URL Search

+ 4
- 4
js/acl.js View File

@@ -50,9 +50,9 @@ ACL.prototype.remove_mention = function(id) {
50 50
 	var addr = this.data[id].addr;
51 51
 
52 52
 	if (addr != "") {
53
-		var searchText = "@" + addr + " ";
53
+		var searchText = "!" + addr + " ";
54 54
 	} else {
55
-		var searchText = "@" + nick + "+" + id + " ";
55
+		var searchText = "!" + nick + "+" + id + " ";
56 56
 	}
57 57
 
58 58
 	var start = this.element.val().indexOf(searchText);
@@ -71,9 +71,9 @@ ACL.prototype.add_mention = function(id) {
71 71
 	var addr = this.data[id].addr;
72 72
 
73 73
 	if (addr != "") {
74
-		var searchText = "@" + addr + " ";
74
+		var searchText = "!" + addr + " ";
75 75
 	} else {
76
-		var searchText = "@" + nick + "+" + id + " ";
76
+		var searchText = "!" + nick + "+" + id + " ";
77 77
 	}
78 78
 
79 79
 	if (this.element.val().indexOf( searchText) >= 0 ) {

+ 2
- 2
mod/network.php View File

@@ -577,9 +577,9 @@ function networkThreadedView(App $a, $update = 0) {
577 577
 			$contact = dba::select('contact', array('addr', 'nick'), $condition, array('limit' => 1));
578 578
 			if (dbm::is_result($contact)) {
579 579
 				if ($contact["addr"] != '') {
580
-					$content = "@".$contact["addr"];
580
+					$content = "!".$contact["addr"];
581 581
 				} else {
582
-					$content = "@".$contact["nick"]."+".$cid;
582
+					$content = "!".$contact["nick"]."+".$cid;
583 583
 				}
584 584
 			}
585 585
 		}

Loading…
Cancel
Save