本文整理汇总了PHP中CHTTP::urnDecode方法的典型用法代码示例。如果您正苦于以下问题:PHP CHTTP::urnDecode方法的具体用法?PHP CHTTP::urnDecode怎么用?PHP CHTTP::urnDecode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHTTP
的用法示例。
在下文中一共展示了CHTTP::urnDecode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRealPath
/**
* Returns script filename by URL
*
* @param string $site Site ID.
* @param string $url URL.
* @return string|null
*/
public static function getRealPath($site, $url)
{
$docRoot = rtrim(\Bitrix\Main\SiteTable::getDocumentRoot($site), '/');
$url = str_replace('\\', '/', $url);
$url = \CHTTP::urnEncode($url);
$uri = new Web\Uri($url);
$path = \CHTTP::urnDecode($uri->getPath());
if (substr($path, -1, 1) == '/') {
$path .= 'index.php';
}
$file = new IO\File($docRoot . $path);
if ($file->isExists()) {
return substr($file->getPath(), strlen($docRoot));
}
if ($rewriteRules = AdminHelper::getRewriteRules($site)) {
$pathQuery = \CHTTP::urnDecode($uri->getPathQuery());
foreach ($rewriteRules as &$item) {
if (preg_match($item['CONDITION'], $pathQuery)) {
$url = empty($item['PATH']) && !empty($item['RULE']) ? preg_replace($item['CONDITION'], $item['RULE'], $pathQuery) : $item['PATH'];
$url = \CHTTP::urnEncode($url);
$uri = new Web\Uri($url);
$path = \CHTTP::urnDecode($uri->getPath());
$file = new IO\File($docRoot . $path);
if ($file->isExists()) {
$pathTmp = str_replace('.', '', strtolower(ltrim($path, '/\\')));
$pathTmp7 = substr($pathTmp, 0, 7);
if ($pathTmp7 == 'upload/' || $pathTmp7 == 'bitrix/') {
continue;
}
if ($file->getExtension() != 'php') {
continue;
}
return substr($file->getPath(), strlen($docRoot));
}
}
}
}
return null;
}
示例2: unEscape
protected function unEscape($data)
{
global $APPLICATION;
if (is_array($data)) {
$res = array();
foreach ($data as $k => $v) {
$k = $APPLICATION->ConvertCharset(\CHTTP::urnDecode($k), "UTF-8", LANG_CHARSET);
$res[$k] = $this->unEscape($v);
}
} else {
$res = $APPLICATION->ConvertCharset(\CHTTP::urnDecode($data), "UTF-8", LANG_CHARSET);
}
return $res;
}
示例3: __UnEscape
/**
* Decodes and converts keys(!) and values
* @param $data
* @return array
*/
private static function __UnEscape($data)
{
$res = $data;
if(is_array($data))
{
$res = array();
foreach($data as $k => $v)
{
$k = $GLOBALS["APPLICATION"]->ConvertCharset(CHTTP::urnDecode($k), "UTF-8", LANG_CHARSET);
$res[$k] = self::__UnEscape($v);
}
}
else
{
$res = $GLOBALS["APPLICATION"]->ConvertCharset(CHTTP::urnDecode($data), "UTF-8", LANG_CHARSET);
}
return $res;
}
示例4: elseif
} elseif ($ob->permission <= "D") {
ShowError(GetMessage("WD_ACCESS_DENIED"));
return false;
}
//=====
//if(class_exists("CWebDavExtLinks"))
//(
if (array_key_exists("GetExtLink", $_REQUEST) && intval($_REQUEST["GetExtLink"]) == 1) {
CWebDavExtLinks::CheckSessID();
CWebDavExtLinks::CheckRights($ob);
CUtil::JSPostUnescape();
$o = array();
$o["PASSWORD"] = array_key_exists("PASSWORD", $_REQUEST) ? $_REQUEST["PASSWORD"] : "";
$o["LIFETIME_NUMBER"] = array_key_exists("LIFETIME_NUMBER", $_REQUEST) ? intval($_REQUEST["LIFETIME_NUMBER"]) : 0;
$o["LIFETIME_TYPE"] = array_key_exists("LIFETIME_TYPE", $_REQUEST) ? $_REQUEST["LIFETIME_TYPE"] : "notlimited";
$o["URL"] = CHTTP::urnDecode($ob->_path);
$o["BASE_URL"] = $arResult['BASE_URL'];
$o["DESCRIPTION"] = array_key_exists("DESCRIPTION", $_REQUEST) ? $_REQUEST["DESCRIPTION"] : "";
$fileOptT = CWebDavExtLinks::GetFileOptions($ob);
$o["F_SIZE"] = $fileOptT["F_SIZE"];
CWebDavExtLinks::GetExtLink($arParams, $o);
}
if (!empty($_REQUEST['toWDController']) || !empty($_REQUEST['showInViewer']) || !empty($_REQUEST['editIn']) || !empty($_REQUEST['history'])) {
include_once $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/webdav/tools/google/document_controller.php';
}
if (array_key_exists("GetDialogDiv", $_REQUEST) && intval($_REQUEST["GetDialogDiv"]) == 1) {
CWebDavExtLinks::CheckSessID();
CWebDavExtLinks::CheckRights($ob);
CWebDavExtLinks::PrintDialogDiv($ob);
}
if (array_key_exists("DeleteLink", $_REQUEST) && strlen($_REQUEST["DeleteLink"]) > 0) {
示例5: strtolower
<?php
/** @var CWebDavIblock $ob */
/** @var CAllMain $APPLICATION */
/** @var CUser $USER */
global $APPLICATION, $USER, $DB;
if (!empty($_REQUEST['editIn'])) {
$ob->_path = CHTTP::urnDecode($ob->_path);
$serviceEditDoc = strtolower($_REQUEST['editIn']);
switch ($serviceEditDoc) {
case 'g':
case 'google':
case 'gdrive':
$serviceEditDoc = CWebDavLogOnlineEditBase::GOOGLE_SERVICE_NAME;
break;
case 's':
case 'skydrive':
case 'sky-drive':
case 'onedrive':
$serviceEditDoc = CWebDavLogOnlineEditBase::SKYDRIVE_SERVICE_NAME;
break;
case 'l':
case 'local':
$serviceEditDoc = CWebDavLogOnlineEditBase::LOCAL_SERVICE_NAME;
break;
default:
$serviceEditDoc = CWebDavLogOnlineEditBase::GOOGLE_SERVICE_NAME;
break;
}
//check: this document edit by another user (with another service?)
$wdElement = $ob->GetObject(array('check_permissions' => false), false);