Example #1
0
 protected static function decode($url)
 {
     return Text\Encoding::convertEncodingToCurrent(urldecode($url));
 }
 public function getRequestedPage()
 {
     if ($this->requestedFile != null) {
         return $this->requestedFile;
     }
     $page = $this->getRequestUri();
     if ($page == "") {
         return $this->requestedFile = parent::getRequestedPage();
     }
     $page = urldecode($page);
     $page = Text\Encoding::convertEncodingToCurrent($page);
     $uri = new Web\Uri($page, Web\UriType::RELATIVE);
     return $this->requestedFile = $uri->convertToPath();
 }
Example #3
0
 public function getRequestedPage()
 {
     if ($this->requestedFile != null) {
         return $this->requestedFile;
     }
     $page = $this->getRequestUri();
     if (empty($page)) {
         $this->requestedFile = parent::getRequestedPage();
         return $this->requestedFile;
     }
     $page = urldecode($page);
     $page = Text\Encoding::convertEncodingToCurrent($page);
     $this->requestedFile = $this->convertToPath($page);
     return $this->requestedFile;
 }
 private function fixUpRequestUriAndQueryString()
 {
     /** @var $context HttpContext */
     $context = $this->context;
     $queryString = $context->getServer()->get("QUERY_STRING");
     $requestUri = $context->getServer()->get("REQUEST_URI");
     $redirectStatus = $context->getServer()->get("REDIRECT_STATUS");
     //try to fix REQUEST_URI under IIS
     $arProtocols = array('http', 'https');
     foreach ($arProtocols as $protocol) {
         $marker = "404;" . $protocol . "://";
         if (($p = strpos($queryString, $marker)) !== false) {
             $uri = $queryString;
             if (($p = strpos($uri, "/", $p + strlen($marker))) !== false) {
                 if ($requestUri == '' || $requestUri == '/404.php' || strpos($requestUri, $marker) !== false) {
                     $requestUri = substr($uri, $p);
                 }
                 $redirectStatus = '404';
                 $queryString = '';
                 break;
             }
         }
     }
     $requestUri = urldecode($requestUri);
     $requestUri = \Bitrix\Main\Text\Encoding::convertEncodingToCurrent($requestUri);
     $sefApplicationCurPageUrl = $context->getRequest()->get("SEF_APPLICATION_CUR_PAGE_URL");
     if ($redirectStatus == '404' || $sefApplicationCurPageUrl != null) {
         if ($redirectStatus != '404') {
             $requestUri = $sefApplicationCurPageUrl;
         }
         if (($pos = strpos($requestUri, "?")) !== false) {
             $queryString = substr($requestUri, $pos + 1);
         }
     }
     if ($queryString != $context->getServer()->get("QUERY_STRING") || $requestUri != $context->getServer()->get("REQUEST_URI") || $redirectStatus != $context->getServer()->get("REDIRECT_STATUS")) {
         $context->rewriteUri($requestUri, $queryString, $redirectStatus);
     }
 }
Example #5
0
 /**
  * Returns url-decoded and converted to the current encoding URI of the request.
  *
  * @return string
  */
 public function getDecodedUri()
 {
     $page = $this->getRequestUri();
     $page = urldecode($page);
     $page = Text\Encoding::convertEncodingToCurrent($page);
     return $page;
 }
Example #6
0
            $result = CVoxImplantConfig::DeleteConfigBySearchId($params['PHONE_NUMBER']);
            CVoxImplantHistory::WriteToLog($result, 'CONTROLLER UNLINK EXPIRE PHONE NUMBER');
            echo json_encode($result);
        } elseif ($params["COMMAND"] == "UpdateOperatorRequest") {
            $params['OPERATOR_CONTRACT'] = \Bitrix\Main\Text\Encoding::convertEncodingToCurrent($params['OPERATOR_CONTRACT']);
            CVoxImplantPhoneOrder::Update($params);
            $result = array('RESULT' => 'OK');
            CVoxImplantHistory::WriteToLog($result, 'UPDATE OPERATOR REQUEST');
            echo json_encode($result);
        } else {
            if ($params["COMMAND"] == "ExternalHungup") {
                $res = Bitrix\Voximplant\CallTable::getList(array('filter' => array('=CALL_ID' => $params['CALL_ID_TMP'])));
                if ($call = $res->fetch()) {
                    Bitrix\Voximplant\CallTable::delete($call['ID']);
                    CVoxImplantOutgoing::SendPullEvent(array('COMMAND' => 'timeout', 'USER_ID' => $call['USER_ID'], 'CALL_ID' => $call['CALL_ID'], 'FAILED_CODE' => intval($params['CALL_FAILED_CODE']), 'MARK' => 'timeout_hit_7'));
                    CVoxImplantHistory::WriteToLog($call, 'EXTERNAL CALL HANGUP');
                }
            } else {
                if ($params["COMMAND"] == "VerifyResult") {
                    $params['REVIEWER_COMMENT'] = \Bitrix\Main\Text\Encoding::convertEncodingToCurrent($params['REVIEWER_COMMENT']);
                    $ViDocs = new CVoxImplantDocuments();
                    $ViDocs->SetVerifyResult($params);
                }
            }
        }
    } else {
        echo "You don't have access to this page.";
    }
}
CMain::FinalActions();
die;