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


PHP iaSanitize::htmlInjectionFilter方法代码示例

本文整理汇总了PHP中iaSanitize::htmlInjectionFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP iaSanitize::htmlInjectionFilter方法的具体用法?PHP iaSanitize::htmlInjectionFilter怎么用?PHP iaSanitize::htmlInjectionFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iaSanitize的用法示例。


在下文中一共展示了iaSanitize::htmlInjectionFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _parseUrl

 protected function _parseUrl()
 {
     $iaView =& $this->iaView;
     $domain = preg_replace('#[^a-z_0-9-.]#i', '', $_SERVER['HTTP_HOST']);
     $requestPath = ltrim($_SERVER['REQUEST_URI'], IA_URL_DELIMITER);
     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::htmlInjectionFilter(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:kreativmind,项目名称:subrion,代码行数:90,代码来源:ia.core.php

示例2: _jsonAction

 protected function _jsonAction()
 {
     $output = array('error' => false, 'message' => array());
     $transaction = array('member_id' => (int) $_POST['member'], 'plan_id' => (int) $_POST['plan'], 'email' => $_POST['email'], 'item_id' => (int) $_POST['itemid'], 'gateway' => (string) $_POST['gateway'], 'sec_key' => uniqid('t'), 'reference_id' => empty($_POST['reference_id']) ? date('mdyHis') : iaSanitize::htmlInjectionFilter($_POST['reference_id']), 'amount' => (double) $_POST['amount'], 'currency' => $this->_iaCore->get('currency'), 'date' => $_POST['date'] . ' ' . $_POST['time']);
     if ($transaction['plan_id']) {
         $this->_iaCore->factory('plan');
         if ($plan = $this->_iaDb->row(iaDb::ALL_COLUMNS_SELECTION, iaDb::convertIds($transaction['plan_id']), iaPlan::getTable())) {
             $transaction['item'] = $plan['item'];
             $transaction['operation'] = iaLanguage::get('plan_title_' . $plan['id']);
         } else {
             $output['error'] = true;
             $output['message'][] = iaLanguage::get('error_plan_not_exists');
         }
     } else {
         $transaction['item'] = iaTransaction::TRANSACTION_MEMBER_BALANCE;
         $transaction['operation'] = iaLanguage::get('funds');
     }
     if (isset($_POST['username']) && $_POST['username']) {
         if ($memberId = $this->_iaDb->one_bind(iaDb::ID_COLUMN_SELECTION, '`username` = :user', array('user' => $_POST['username']), iaUsers::getTable())) {
             $transaction['member_id'] = $memberId;
         } else {
             $output['error'] = true;
             $output['message'][] = iaLanguage::get('incorrect_username');
         }
     }
     if ($transaction['email'] && !iaValidate::isEmail($transaction['email'])) {
         $output['error'] = true;
         $output['message'][] = iaLanguage::get('error_email_incorrect');
     }
     if (isset($transaction['item']) && in_array($transaction['item'], array(iaTransaction::TRANSACTION_MEMBER_BALANCE, 'members'))) {
         $transaction['item_id'] = $transaction['member_id'];
     }
     if (!$output['error']) {
         $output['success'] = (bool) $this->_iaDb->insert($transaction);
         $output['message'] = $output['success'] ? iaLanguage::get('transaction_added') : iaLanguage::get('invalid_parameters');
     }
     if (isset($output['success']) && $output['success']) {
         $this->_iaCore->startHook('phpTransactionCreated', array('id' => $output['success'], 'transaction' => $transaction));
         $output['success'] = (bool) $output['success'];
     }
     return $output;
 }
开发者ID:kreativmind,项目名称:subrion,代码行数:42,代码来源:transactions.php

示例3: _updateCustomParam

 protected function _updateCustomParam($key, $value)
 {
     switch ($key) {
         case 'https':
             $baseUrl = $this->_iaCore->get('baseurl');
             $newBaseUrl = 'http' . ($value ? 's' : '') . substr($baseUrl, strpos($baseUrl, '://'));
             $this->_iaDb->update(array('value' => $newBaseUrl), iaDb::convertIds('baseurl', 'name'));
             $this->_redirectUrl = str_replace($baseUrl, $newBaseUrl, IA_SELF);
             break;
         case 'admin_page':
             $this->_redirectUrl = IA_URL . iaSanitize::htmlInjectionFilter($value) . '/configuration/general/';
     }
     return true;
 }
开发者ID:rentpad,项目名称:subrion,代码行数:14,代码来源:configuration.php


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