Example #1
0
 unset($groupCache);
 $arLocalPath = _wdCleanUpForbiddenSymbols(explode('/', trim($localPath, '/')));
 if (empty($arLocalPath[0])) {
     unset($arLocalPath[0]);
 }
 if (sizeof($arLocalPath) > 0) {
     if (preg_match("/" . GetMessage('SONET_GROUP') . " (\\d+)/", $arLocalPath[0], $matches) == 0) {
         $arFilter = array("IBLOCK_ID" => $arParams["IBLOCK_GROUP_ID"], "SECTION_ID" => 0, "CHECK_PERMISSIONS" => "N");
         $dbSection = CIBlockSection::GetList(array(), $arFilter, false, array('ID', 'NAME', 'SOCNET_GROUP_ID'));
         $sectionID = 0;
         while ($arGroupSection = $dbSection->Fetch()) {
             $groupName = $arGroupSection['NAME'];
             if (strpos($groupName, GetMessage('SONET_GROUP_PREFIX')) === 0) {
                 $groupName = substr($groupName, strlen(GetMessage('SONET_GROUP_PREFIX')));
             }
             $groupName = str_replace("/", "", _wdCleanUpForbiddenSymbols(htmlspecialcharsBack($groupName)));
             if ($groupName == $arLocalPath[0]) {
                 $sectionID = $arGroupSection['ID'];
                 $arVariables['GROUP_ID'] = $arGroupSection['SOCNET_GROUP_ID'];
                 break;
             }
         }
         if ($sectionID == 0) {
             CHTTP::SetStatus('404 Not Found');
             ShowError(GetMessage("WD_GROUP_SECTION_FILES_NOT_FOUND"));
             return 0;
         }
     } else {
         $arFilter = array("IBLOCK_ID" => $arParams["IBLOCK_GROUP_ID"], "CHECK_PERMISSIONS" => "N", "SOCNET_GROUP_ID" => $matches[1]);
         $dbSection = CIBlockSection::GetList(array(), $arFilter, false, array('ID', 'SOCNET_GROUP_ID'));
         if ($arGroupSection = $dbSection->Fetch()) {
Example #2
0
 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;
 }