当前位置: 首页>>代码示例>>PHP>>正文


PHP iaSanitize::urlInjectionFilter方法代码示例

本文整理汇总了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);
 }
开发者ID:UzielSilva,项目名称:subrion,代码行数:90,代码来源:ia.core.php


注:本文中的iaSanitize::urlInjectionFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。