Skip to content

Commit 7a6ee77

Browse files
committedJul 2, 2012
Fixed WebGUI::Asset::Wobject::Search::view() so HTML highlighting not broken by search phrase with unmatched char pairs
Fixed WebGUI::Asset::Wobject::Search::view() so HTML highlighting will not be broken by a search phrase with unmatched char pairs like '()', '{}', and '[]' (the HTML highlighter uses a regex internally for matching words in the search phrase). Also fixed so ':' in the search phrase does not confuse the HTML highlighter.

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎docs/changelog/7.x.x.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
7.10.25
2+
- fixed: #12373: Asset::Wobject::Search::view() so HTML highlite not broken by search phrase with unmatched char pairs
23
- fixed: if user1 adds user2 as a friend, user2 doesn't see user1 as a friend
34
- fixed: data sync bug in WebGUI::User::friends
45
- added: give WebGUI::PseudoRequest a hostname method

‎lib/WebGUI/Asset/Wobject/Search.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ sub view {
199199
$search->search(\%rules);
200200

201201
#Instantiate the highlighter
202-
my @words = grep { $_ ne '' } map { tr/+?*//d; $_; } split(/\s+/,$keywords);
202+
my @words = grep { $_ ne '' } map { tr/+?*:()[]{}//d; $_; } split(/\s+/,$keywords);
203203
my @wildcards = map { "%" } @words;
204204
my $hl = HTML::Highlight->new(
205205
words => \@words,

0 commit comments

Comments
 (0)
Please sign in to comment.