From 67a9aceee4ee3d40b66bc3fa2e36a095688dc938 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Thu, 17 Jan 2019 17:27:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/indexes.php | 3 ++- functions/search.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/functions/indexes.php b/functions/indexes.php index 1da8e92..5bafa69 100644 --- a/functions/indexes.php +++ b/functions/indexes.php @@ -26,7 +26,8 @@ function tree($directory,$ignore) { //echo $uri; //exit; $filepath = "$directory/$file"; - $url = $uri.'/'.$file; + $url = $uri.'/'.$directory.'/'.$file; + $url = str_replace("../","",$url); echo "
  • $url
  • \n"; } diff --git a/functions/search.php b/functions/search.php index f7e349c..6527826 100644 --- a/functions/search.php +++ b/functions/search.php @@ -4,15 +4,17 @@ $s = @$_GET['s']; $s = trim($s); $s = strip_tags($s); + $s = strtolower($s); $text = strip_tags($html); $arr = explode("\n",$text); $txt = array(); foreach( $arr as $value ) { - if((strpos($value,$s)) || (strpos($value,$s) === 0)){ + if((stripos($value,$s)) || (stripos($value,$s) === 0)){ //echo $value.'--'; $value = trim($value); + //$value = strtolower($value); //如果值带有.,说明是一个文件 if(strpos($value,'.')){ array_push($txt,$value);