Skip to content
Snippets Groups Projects
Commit 23e31e76 authored by Szymon Olewniczak's avatar Szymon Olewniczak
Browse files

implement globbing media search

parent afd1160b
No related branches found
No related tags found
No related merge requests found
......@@ -1492,7 +1492,11 @@ function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort='natural
$dir = utf8_encodeFN(str_replace(':','/',$evdata['ns']));
$quoted = preg_quote($evdata['query'],'/');
//apply globbing
$quoted = str_replace(array('\*', '\?'), array('.*', '.'), $quoted);
$quoted = str_replace(array('\*', '\?'), array('.*', '.'), $quoted, $count);
//if we use globbing file name must match entirely but may be preceded by arbitrary namespace
if ($count > 0) $quoted = '^([^:]*:)*'.$quoted.'$';
$pattern = '/'.$quoted.'/i';
search($evdata['data'],
$conf['mediadir'],
......
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