protected function getFileUrl(File $f) { static $arIndexNames; if (!is_array($arIndexNames)) { $arIndexNames = GetDirIndexArray(); } if (substr($this->path, 0, strlen($this->documentRoot)) === $this->documentRoot) { $path = '/' . substr($f->getPath(), strlen($this->documentRoot)); } $path = Path::convertLogicalToUri($path); $path = in_array($f->getName(), $arIndexNames) ? str_replace('/' . $f->getName(), '/', $path) : $path; return '/' . ltrim($path, '/'); }