Skip to content

Commit

Permalink
修复BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
helloxz committed Jan 17, 2019
1 parent acf6ab6 commit 67a9ace
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion functions/indexes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<li><i class='fa fa-file-text-o'></i> <a href = '$url' target = '_blank'>$url</a></li>\n";
}

Expand Down
4 changes: 3 additions & 1 deletion functions/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 67a9ace

Please sign in to comment.