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


PHP CHttpRequest::normalizeRequest方法代码示例

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


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

示例1: normalizeRequest

 /**
  * Normalizes the request data.
  * This method strips off slashes in request data if get_magic_quotes_gpc() returns true.
  * It also performs CSRF validation if {@link enableCsrfValidation} is true.
  */
 protected function normalizeRequest()
 {
     parent::normalizeRequest();
     if ($this->getIsPostRequest() && $this->enableCsrfValidation && $this->checkCurrentRoute()) {
         Yii::app()->detachEventHandler('onbeginRequest', array($this, 'validateCsrfToken'));
     }
 }
开发者ID:hansenmakangiras,项目名称:disperindag2,代码行数:12,代码来源:DHttpRequest.php

示例2: normalizeRequest

 /**
  * @see CHttpRequest::normalizeRequest()
  */
 protected function normalizeRequest()
 {
     $this->normalizeEOL($_POST);
     $this->normalizeEOL($_GET);
     $this->normalizeEOL($_REQUEST);
     parent::normalizeRequest();
 }
开发者ID:cebe,项目名称:chive,代码行数:10,代码来源:ChiveHttpRequest.php

示例3: normalizeRequest

 protected function normalizeRequest()
 {
     parent::normalizeRequest();
     if ($this->enableCsrfValidation) {
         $url = Yii::app()->getUrlManager()->parseUrl($this);
         if (in_array($url, $this->noValidationRoutes)) {
             Yii::app()->detachEventHandler('onBeginRequest', array($this, 'validateCsrfToken'));
         }
     }
 }
开发者ID:Sywooch,项目名称:olx-rooms-parser,代码行数:10,代码来源:HttpRequest.php

示例4: normalizeRequest

 protected function normalizeRequest()
 {
     //attach event handlers for CSRFin the parent
     parent::normalizeRequest();
     //remove the event handler CSRF if this is a route we want skipped
     if (!Common::isCli() && $this->enableCsrfValidation) {
         $url = Yii::app()->getUrlManager()->parseUrl($this);
         foreach ($this->noCsrfValidationRoutes as $route) {
             if (strpos($url, $route) === 0) {
                 Yii::app()->detachEventHandler('onBeginRequest', array($this, 'validateCsrfToken'));
             }
         }
     }
 }
开发者ID:amanukian,项目名称:test,代码行数:14,代码来源:HttpRequest.php

示例5: normalizeRequest

 protected function normalizeRequest()
 {
     //attach event handlers for CSRFin the parent
     parent::normalizeRequest();
     //remove the event handler CSRF if this is a route we want skipped
     if ($this->enableCsrfValidation) {
         $url = Yii::app()->getUrlManager()->parseUrl($this);
         $t = strpos($url, "/");
         if ($t !== FALSE) {
             $url = substr($url, 0, $t);
             if (in_array($url, $this->noCsrfValidationRoutes)) {
                 Yii::app()->detachEventHandler('onBeginRequest', array($this, 'validateCsrfToken'));
             }
         }
     }
 }
开发者ID:a707937337,项目名称:bscy,代码行数:16,代码来源:HttpRequest.php

示例6: normalizeRequest

    protected function normalizeRequest(){
        parent::normalizeRequest();
        
        if($_SERVER['REQUEST_METHOD'] != 'POST') return;

        $route = Yii::app()->getUrlManager()->parseUrl($this);
        if($this->enableCsrfValidation){
        	foreach($this->noCsrfValidationRoutes as $cr){
                if(preg_match('#'.$cr.'#', $route)){
                    Yii::app()->detachEventHandler('onBeginRequest',
                        array($this,'validateCsrfToken'));
                    Yii::trace('Route "'.$route.' passed without CSRF validation');
                    break; // found first route and break
                }
            }
        }
    }
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:17,代码来源:HttpRequest.php

示例7: normalizeRequest

 protected function normalizeRequest()
 {
     //attach event handlers for CSRFin the parent
     parent::normalizeRequest();
     //remove the event handler CSRF if this is a route we want skipped
     if ($this->enableCsrfValidation) {
         //$url=Yii::app()->getUrlManager()->parseUrl($this);
         $route1 = Yii::app()->createController(Yii::app()->getUrlManager()->parseUrl(new CHttpRequest()));
         $url = $route1 ? $route1[0]->id : "";
         foreach ($this->noCsrfValidationRoutes as $route) {
             $url = strtolower($url);
             $route = strtolower($route);
             if (strpos($url, $route) === 0) {
                 Yii::app()->detachEventHandler('onBeginRequest', array($this, 'validateCsrfToken'));
             }
         }
     }
 }
开发者ID:rubipikachu,项目名称:xoso-lechung,代码行数:18,代码来源:HttpRequest.php

示例8: normalizeRequest

 /**
  *Extends CHttpRequest::normalizeRequest to support 'enableCsrfValidationRoutes' attribute
  * The new attribute allows you to enable CSRF token validation on a list of routes
  */
 protected function normalizeRequest()
 {
     //attach event handlers for CSRFin the parent
     parent::normalizeRequest();
     //remove the event handler CSRF if this is a route we want skipped
     if ($this->enableCsrfValidation) {
         $url = $_SERVER['REQUEST_URI'];
         $enableValidation = false;
         foreach ($this->enableCsrfValidationRoutes as $route) {
             if (strpos($url, $route) === 0) {
                 $enableValidation = true;
                 break;
             }
         }
         if (!$enableValidation) {
             Yii::app()->detachEventHandler('onBeginRequest', array($this, 'validateCsrfToken'));
         }
     }
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:23,代码来源:HttpRequest.php

示例9: normalizeRequest

 /**
  * Normalize request.
  * Disable CSRF for payment controller
  */
 protected function normalizeRequest()
 {
     parent::normalizeRequest();
     if ($this->enableCsrfValidation && $this->isCLI() === false) {
         $url = $this->getRequestUri();
         foreach ($this->noCsrfValidationRoutes as $route) {
             if (substr($url, 0, strlen($route)) === $route) {
                 Yii::app()->detachEventHandler('onBeginRequest', array($this, 'validateCsrfToken'));
             }
         }
     }
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:16,代码来源:SHttpRequest.php


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