當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。