} if (isset($_SERVER['HTTP_DESTINATION'])) { $_SERVER['HTTP_DESTINATION'] = CWebDavBase::_udecode($_SERVER['HTTP_DESTINATION']); $pu = parse_url($_SERVER['HTTP_DESTINATION']); $pu['path'] = _wdFormatRequestUrl($pu['path'], $arParams); foreach ($modes as $modeName => $path) { if ($daw === 'D') { $path = _wdCleanUpForbiddenSymbols($path); } if (preg_match_all("'/{$path}(.*)'", $pu['path'], $arValues)) { $destPath = $arValues[1][0]; break; } } } $rootPath = CWebDavBase::_udecode($arParams['SEF_FOLDER'] . $modes[$mode]); if ($daw === 'D') { $rootPath = _wdCleanUpForbiddenSymbols($rootPath); } if ($currentPageUrl != '/') { $currentPageUrl = rtrim($currentPageUrl, '/'); } $folderTree = array(); $depth = 0; // OTHER SHARES // ****************************************************** if ($mode == 'root') { foreach ($arParams['IBLOCK_OTHER_IDS'] as $id) { if (isset($modes[$id])) { $path = $arParams['SEF_FOLDER'] . $modes[$id]; $name = $arParams['SEF_FOLDER'] . urldecode($modes[$id]);
function _wdFormatRequestUrl($url, $arParams) { $result = $url; $dav = CWebDavBase::IsDavHeaders('check_all') ? 'D' : 'W'; $currentPageUrl = SubStr($url, StrLen($arParams["SEF_FOLDER"])); if ($currentPageUrl == false) { $currentPageUrl = '/'; } if ($dav == 'W') { if (isset($_REQUEST['target'])) { $currentPageUrl = CWebDavBase::_udecode($_REQUEST['target']); } $currentPageUrl = htmlspecialcharsBack($currentPageUrl); } else { $currentPageUrl = _wdCleanUpForbiddenSymbols($currentPageUrl); } $currentPageUrl = html_entity_decode($currentPageUrl, ENT_QUOTES); if (!preg_match("'^/'", $currentPageUrl)) { $currentPageUrl = '/' . $currentPageUrl; } if (!preg_match("'/\$'", $currentPageUrl)) { $currentPageUrl = $currentPageUrl . '/'; } return $currentPageUrl; }