Browse Source

bug fix: wrong webroot for dirs

master
filesite 5 months ago
parent
commit
2844e4093d
  1. 8
      controller/Controller.php

8
controller/Controller.php

@ -311,12 +311,12 @@ Class Controller { @@ -311,12 +311,12 @@ Class Controller {
return "{$prefix}_{$dataType}_{$maxScanDeep}_{$cateId}";
}
protected function getCurrentWebroot($realpath) {
$realpath = preg_replace('/\/[^\/]+\.[^\/]+$/', '', $realpath); //删除文件名,只保留目录
if (empty($realpath)) {return '/';}
//根据目录的绝对路径,获取网站的相对路径
protected function getCurrentWebroot($dir_realpath) {
if (empty($dir_realpath)) {return '/';}
$webroot = FSC::$app['config']['content_directory'];
$arr = explode($webroot, $realpath);
$arr = explode($webroot, $dir_realpath);
if (count($arr) < 2) {
return $webroot;
}

Loading…
Cancel
Save