Added search support for filenames with spaces

This commit is contained in:
xevidos 2019-10-24 09:26:29 -04:00
parent c85c920340
commit 6949de42ff

View file

@ -649,7 +649,7 @@ class Filemanager extends Common {
$return = array();
$input = str_replace( '"', '', $query );
$cmd = 'find -L ' . escapeshellarg( $path ) . ' -iregex '.escapeshellarg( '.*' . $options["filetype"] ) . ' -type f | xargs grep -i -I -n -R -H ' . escapeshellarg( $input ) . '';
$cmd = 'find -L ' . escapeshellarg( $path ) . ' -iregex '.escapeshellarg( '.*' . $options["filetype"] ) . ' -type f -print0 | xargs -0 grep -i -I -n -R -H ' . escapeshellarg( $input ) . '';
$output = shell_exec( $cmd );
$output_arr = explode( "\n", $output );
foreach ( $output_arr as $line ) {