- Модуль: seo
- Путь к файлу: ~/bitrix/modules/seo/lib/Sitemap/File/Base.php
- Класс: BitrixSeoSitemapFilefor
- Вызов: for::getFileUrl
protected function getFileUrl(File $f)
{
static $indexNames;
if(!is_array($indexNames))
{
$indexNames = GetDirIndexArray();
}
$documentRoot = Path::normalize($this->documentRoot);
$path = '/';
if (mb_substr($this->path, 0, mb_strlen($documentRoot)) === $documentRoot)
{
$path = '/'.mb_substr($f->getPath(), mb_strlen($documentRoot));
}
$path = Path::convertLogicalToUri($path);
$path = in_array($f->getName(), $indexNames)
? str_replace('/'.$f->getName(), '/', $path)
: $path;
return '/'.ltrim($path, '/');
}