Robert Vogel has submitted this change and it was merged. 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(-) Approvals: Robert Vogel: Verified; Looks good to me, approved 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: merged Gerrit-Change-Id: I1e2780aab8d7888e7f35dd7a6d148f4d8710e7c8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Tweichart <weich...@hallowelt.biz> Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz> Gerrit-Reviewer: Pigpen <reym...@hallowelt.biz> Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits