本文整理汇总了PHP中iaSanitize::urlInjectionFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP iaSanitize::urlInjectionFilter方法的具体用法?PHP iaSanitize::urlInjectionFilter怎么用?PHP iaSanitize::urlInjectionFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaSanitize
的用法示例。
在下文中一共展示了iaSanitize::urlInjectionFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _parseUrl
protected function _parseUrl()
{
$iaView =& $this->iaView;
$domain = $_SERVER['HTTP_HOST'];
$requestPath = preg_replace('#^\\/#', '', $_SERVER['REQUEST_URI']);
if (!preg_match('#^www\\.#', $domain) && preg_match('#:\\/\\/www\\.#', $this->get('baseurl'))) {
$domain = preg_replace('#^#', 'www.', $domain);
$this->factory('util')->go_to('http://' . $domain . IA_URL_DELIMITER . $requestPath);
} elseif (preg_match('#^www\\.#', $domain) && !preg_match('#:\\/\\/www\\.#', $this->get('baseurl'))) {
$domain = preg_replace('#^www\\.#', '', $domain);
$this->factory('util')->go_to('http://' . $domain . IA_URL_DELIMITER . $requestPath);
}
$iaView->assetsUrl = '//' . $domain . IA_URL_DELIMITER . FOLDER_URL;
$iaView->domain = $domain;
$iaView->domainUrl = 'http' . (isset($_SERVER['HTTPS']) && 'on' == $_SERVER['HTTPS'] ? 's' : '') . ':' . $iaView->assetsUrl;
$iaView->language = $this->get('lang');
$doExit = false;
$changeLang = false;
if (isset($_GET['_p'])) {
$url = $_GET['_p'];
unset($_GET['_p']);
} else {
$url = !isset($_SERVER['REDIRECT_URL']) || $_SERVER['REQUEST_URI'] != $_SERVER['REDIRECT_URL'] ? $_SERVER['REQUEST_URI'] : $_SERVER['REDIRECT_URL'];
$url = substr($url, strlen(FOLDER) + 1);
}
$extension = IA_URL_DELIMITER;
$url = explode('?', $url);
$url = array_shift($url);
$url = explode(IA_URL_DELIMITER, iaSanitize::urlInjectionFilter(trim($url, IA_URL_DELIMITER)));
$lastChunk = end($url);
if ($pos = strrpos($lastChunk, '.')) {
$extension = substr($lastChunk, $pos + 1);
switch ($extension) {
case self::EXTENSION_JSON:
$iaView->setRequestType(iaView::REQUEST_JSON);
break;
case self::EXTENSION_XML:
$iaView->setRequestType(iaView::REQUEST_XML);
}
$extension = '.' . $extension;
$url = str_replace($extension, '', $url);
}
$iaView->set('extension', $extension);
if (isset($_POST['_lang']) && isset($this->languages[$_POST['_lang']])) {
$iaView->language = $_POST['_lang'];
$changeLang = true;
}
$isSystemChunk = true;
$array = array();
foreach ($url as $value) {
if (!$isSystemChunk) {
$array[] = $value;
continue;
}
switch (true) {
case $this->get('admin_page') == $value:
// admin panel
$this->_accessType = self::ACCESS_ADMIN;
continue 2;
case 'logout' == $value:
// logging out
$doExit = true;
continue 2;
case 2 == strlen($value):
// current language
if (isset($this->languages[$value])) {
$changeLang || ($iaView->language = $value);
array_shift($url);
// #1715
continue 2;
}
default:
$iaView->name(empty($value) && 1 == count($url) ? $this->get('home_page') : $value);
$isSystemChunk = false;
}
}
if (self::ACCESS_ADMIN == $this->getAccessType()) {
if ($isSystemChunk && $this->get('home_page') == $iaView->name()) {
$iaView->name(iaView::DEFAULT_HOMEPAGE);
}
}
$iaView->url = empty($url[0]) ? array() : $url;
$this->requestPath = $array;
// set system language
$this->language = $this->languages[$iaView->language];
// set dynamic config
$this->set('date_format', $this->language['date_format']);
$this->set('locale', $this->language['locale']);
define('IA_EXIT', $doExit);
}