From be49a13b8e55f0bee16cdca600e9c32cf6a713b9 Mon Sep 17 00:00:00 2001 From: Rizky Date: Mon, 7 Nov 2022 23:53:01 +0700 Subject: [PATCH] Fixes advanced search not working. (#878) Fix #869 --- tinyfilemanager.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 6e74bd1..35fd57a 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -424,6 +424,17 @@ unset($p, $use_auth, $iconv_input_encoding, $use_highlightjs, $highlightjs_style /*************************** ACTIONS ***************************/ // AJAX Request + +if (isset($_POST['ajax'])) { + //search : get list of files from the current folder + if(isset($_POST['type']) && $_POST['type']=="search") { + $dir = FM_ROOT_PATH; + $response = scan(fm_clean_path($_POST['path']), $_POST['content']); + echo json_encode($response); + exit(); + } +} + if (isset($_POST['ajax']) && !FM_READONLY) { // save @@ -626,15 +637,6 @@ if (isset($_POST['ajax']) && !FM_READONLY) { exit(); } -if (isset($_POST['ajax'])) { - //search : get list of files from the current folder - if(isset($_POST['type']) && $_POST['type']=="search") { - $dir = FM_ROOT_PATH; - $response = scan(fm_clean_path($_POST['path']), $_POST['content']); - echo json_encode($response); - exit(); - } -} // Delete file / folder if (isset($_GET['del']) && !FM_READONLY) {