Skip to content
Snippets Groups Projects
Unverified Commit 940f24fc authored by Michael Große's avatar Michael Große
Browse files

fix(search): don't truncate namespaces with - and . in pagename-lookup

The regex for the pagename lookup didn't account for `-` and `.` being
valid characters for namespaces, which lead to wrong results in the
quicksearch and pagename lookup. The full search, which already used the
queryParser, showed the correct results.

This fixes #1659
parent b3cfe85a
No related branches found
No related tags found
No related merge requests found
......@@ -233,9 +233,11 @@ function ft_pageLookup($id, $in_ns=false, $in_title=false){
function _ft_pageLookup(&$data){
// split out original parameters
$id = $data['id'];
if (preg_match('/(?:^| )(?:@|ns:)([\w:]+)/', $id, $matches)) {
$ns = cleanID($matches[1]) . ':';
$id = str_replace($matches[0], '', $id);
$Indexer = idx_get_indexer();
$parsedQuery = ft_queryParser($Indexer, $id);
if (count($parsedQuery['ns']) > 0) {
$ns = cleanID($parsedQuery['ns'][0]) . ':';
$id = implode(' ', $parsedQuery['highlight']);
}
$in_ns = $data['in_ns'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment