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

Loading…
Cancel
Save