Tweichart has uploaded a new change for review.
https://gerrit.wikimedia.org/r/190805
Change subject: fixed regex to match everything except whitespaces
......................................................................
fixed regex to match everything except whitespaces
Change-Id: I1e2780aab8d7888e7f35dd7a6d148f4d8710e7c8
---
M ShoutBox/ShoutBox.class.php
M ShoutBox/resources/bluespice.shoutBox.mention.js
2 files changed, 3 insertions(+), 3 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/05/190805/1
diff --git a/ShoutBox/ShoutBox.class.php b/ShoutBox/ShoutBox.class.php
index a41827d..fce9549 100644
--- a/ShoutBox/ShoutBox.class.php
+++ b/ShoutBox/ShoutBox.class.php
@@ -323,7 +323,7 @@
while ( $row = $dbr->fetchRow( $res ) ) {
$oUser = User::newFromId( $row['sb_user_id'] );
$oProfile =
BsCore::getInstance()->getUserMiniProfile( $oUser );
- $sMessage = preg_replace_callback("#@(\w*)#",
"self::replaceUsernameInMessage", $row['sb_message']);
+ $sMessage = preg_replace_callback("#@(\S*)#",
"self::replaceUsernameInMessage", $row['sb_message']);
$oShoutBoxMessageView = new
ViewShoutBoxMessage();
if ( $bShowAge )
$oShoutBoxMessageView->setDate(
BsFormatConverter::mwTimestampToAgeString( $row['sb_timestamp'], true ) );
@@ -546,7 +546,7 @@
public static function getUsersMentioned( $sMessage ) {
if ( empty( $sMessage ) )
return array();
- $bResult = preg_match_all( "#@(\w*)#", $sMessage, $aMatches );
+ $bResult = preg_match_all( "#@(\S*)#", $sMessage, $aMatches );
if ( $bResult === false || $bResult < 1 )
return array();
$aReturn = array();
diff --git a/ShoutBox/resources/bluespice.shoutBox.mention.js
b/ShoutBox/resources/bluespice.shoutBox.mention.js
index b52e731..ca0114c 100644
--- a/ShoutBox/resources/bluespice.shoutBox.mention.js
+++ b/ShoutBox/resources/bluespice.shoutBox.mention.js
@@ -2,7 +2,7 @@
var BSShoutboxMentions = {
mentions: [ ],
//matches whole words starting with @
- match: /\B@(\w*)$/,
+ match: /\B@(\S*)$/,
search: function ( term, callback ) {
//if the mentions array is empty get a list of all
users available
//first trigger with the @ in the shoutbox to not
overload requests
--
To view, visit https://gerrit.wikimedia.org/r/190805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e2780aab8d7888e7f35dd7a6d148f4d8710e7c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Tweichart <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits