Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pbmarklf committed Jul 2, 2012
1 parent dc4f813 commit 7a6ee77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
@@ -1,4 +1,5 @@
7.10.25
- fixed: #12373: Asset::Wobject::Search::view() so HTML highlite not broken by search phrase with unmatched char pairs
- fixed: if user1 adds user2 as a friend, user2 doesn't see user1 as a friend
- fixed: data sync bug in WebGUI::User::friends
- added: give WebGUI::PseudoRequest a hostname method
Expand Down
2 changes: 1 addition & 1 deletion lib/WebGUI/Asset/Wobject/Search.pm
Expand Up @@ -199,7 +199,7 @@ sub view {
$search->search(\%rules);

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

0 comments on commit 7a6ee77

Please sign in to comment.