Issue 3860: Enhanced support of "!" for forums
This commit is contained in:
parent
7003f576e2
commit
d739fe2503
|
@ -307,7 +307,7 @@ class exAuth {
|
||||||
*/
|
*/
|
||||||
private function writeLog($sMessage) {
|
private function writeLog($sMessage) {
|
||||||
if (is_resource($this->rLogFile))
|
if (is_resource($this->rLogFile))
|
||||||
fwrite($this->rLogFile, date("r")." ".$sMessage."\n");
|
fwrite($this->rLogFile, date("r")." ".getmypid()." ".$sMessage."\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -940,17 +940,17 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
||||||
|
|
||||||
// Remove all hashtag addresses
|
// Remove all hashtag addresses
|
||||||
if ((!$tryoembed || $simplehtml) && !in_array($simplehtml, array(3, 7))) {
|
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) {
|
} elseif ($simplehtml == 3) {
|
||||||
$Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
||||||
'$1<a href="$2">$3</a>',
|
'$1<a href="$2">$3</a>',
|
||||||
$Text);
|
$Text);
|
||||||
} elseif ($simplehtml == 7) {
|
} elseif ($simplehtml == 7) {
|
||||||
$Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
||||||
'$1<span class="vcard"><a href="$2" class="url" title="$3"><span class="fn nickname mention">$3</span></a></span>',
|
'$1<span class="vcard"><a href="$2" class="url" title="$3"><span class="fn nickname mention">$3</span></a></span>',
|
||||||
$Text);
|
$Text);
|
||||||
} elseif (!$simplehtml) {
|
} elseif (!$simplehtml) {
|
||||||
$Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
||||||
'$1<a href="$2" class="userinfo mention" title="$3">$3</a>',
|
'$1<a href="$2" class="userinfo mention" title="$3">$3</a>',
|
||||||
$Text);
|
$Text);
|
||||||
}
|
}
|
||||||
|
@ -962,13 +962,13 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
||||||
"[bookmark=$1]$2[/bookmark]", $Text);
|
"[bookmark=$1]$2[/bookmark]", $Text);
|
||||||
|
|
||||||
if (in_array($simplehtml, array(2, 6, 7, 8, 9))) {
|
if (in_array($simplehtml, array(2, 6, 7, 8, 9))) {
|
||||||
$Text = preg_replace_callback("/([^#@])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", "bb_expand_links", $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("/[^#@!]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $Text);
|
||||||
$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", ' $2 [url]$1[/url]',$Text);
|
$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", ' $2 [url]$1[/url]',$Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($simplehtml == 5) {
|
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
|
// Perform URL Search
|
||||||
|
|
|
@ -50,9 +50,9 @@ ACL.prototype.remove_mention = function(id) {
|
||||||
var addr = this.data[id].addr;
|
var addr = this.data[id].addr;
|
||||||
|
|
||||||
if (addr != "") {
|
if (addr != "") {
|
||||||
var searchText = "@" + addr + " ";
|
var searchText = "!" + addr + " ";
|
||||||
} else {
|
} else {
|
||||||
var searchText = "@" + nick + "+" + id + " ";
|
var searchText = "!" + nick + "+" + id + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
var start = this.element.val().indexOf(searchText);
|
var start = this.element.val().indexOf(searchText);
|
||||||
|
@ -71,9 +71,9 @@ ACL.prototype.add_mention = function(id) {
|
||||||
var addr = this.data[id].addr;
|
var addr = this.data[id].addr;
|
||||||
|
|
||||||
if (addr != "") {
|
if (addr != "") {
|
||||||
var searchText = "@" + addr + " ";
|
var searchText = "!" + addr + " ";
|
||||||
} else {
|
} else {
|
||||||
var searchText = "@" + nick + "+" + id + " ";
|
var searchText = "!" + nick + "+" + id + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.element.val().indexOf( searchText) >= 0 ) {
|
if (this.element.val().indexOf( searchText) >= 0 ) {
|
||||||
|
|
|
@ -577,9 +577,9 @@ function networkThreadedView(App $a, $update = 0) {
|
||||||
$contact = dba::select('contact', array('addr', 'nick'), $condition, array('limit' => 1));
|
$contact = dba::select('contact', array('addr', 'nick'), $condition, array('limit' => 1));
|
||||||
if (dbm::is_result($contact)) {
|
if (dbm::is_result($contact)) {
|
||||||
if ($contact["addr"] != '') {
|
if ($contact["addr"] != '') {
|
||||||
$content = "@".$contact["addr"];
|
$content = "!".$contact["addr"];
|
||||||
} else {
|
} else {
|
||||||
$content = "@".$contact["nick"]."+".$cid;
|
$content = "!".$contact["nick"]."+".$cid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue