Skip to content

Commit 3d01fa5

Browse files
authored
Merge pull request #956 from metacpan/oalders/colon
Fix author/dist/module searches
2 parents 0b029ef + 96905c8 commit 3d01fa5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/MetaCPAN/Model/Search.pm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,17 @@ sub search_web {
8080
$from //= 0;
8181

8282
$search_term
83-
=~ s{([ + - = > < ! & | ( ) { } \[ \] ^ " ~ * ? : \ / ])}{\\$1}x;
83+
=~ s{([ + - = > < ! & | ( ) { } \[ \] ^ " ~ * ? \ / ])}{\\$1}x;
8484

8585
# munge the search_term
8686
# these would be nicer if we had variable-length lookbehinds...
8787
# Allow q = 'author:LLAP' or 'module:Data::Page' or 'dist:'
8888
# We are mapping to correct ES fields here - wonder if ANYONE
8989
# uses these?!?!?!
90+
#
91+
# The exceptions below are used specifically by the front end search.
92+
# We've temporarily removed the ":" from the regex above so that the the
93+
# author/dist/module searches work again. The were broken in 225749b6e.
9094
$search_term #
9195
=~ s{(^|\s)author:([a-zA-Z]+)(?=\s|$)}{$1author:\U$2\E}g;
9296
$search_term

0 commit comments

Comments
 (0)