From 6949de42ff7f246cfed7cd17948324e38d0a68b8 Mon Sep 17 00:00:00 2001
From: xevidos <xevidos@gmail.com>
Date: Thu, 24 Oct 2019 09:26:29 -0400
Subject: [PATCH] Added search support for filenames with spaces

---
 components/filemanager/class.filemanager.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/filemanager/class.filemanager.php b/components/filemanager/class.filemanager.php
index 1870d8b..450ffcb 100755
--- a/components/filemanager/class.filemanager.php
+++ b/components/filemanager/class.filemanager.php
@@ -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 ) {