コード例 #1
0
ファイル: Request.php プロジェクト: mesushan/FirstRepo
 /**
  * Sets a list of trusted host patterns.
  *
  * You should only list the hosts you manage using regexs.
  *
  * @param array $hostPatterns A list of trusted host patterns
  */
 public static function setTrustedHosts(array $hostPatterns)
 {
     self::$trustedHostPatterns = array_map(function ($hostPattern) {
         return sprintf('{%s}i', str_replace('}', '\\}', $hostPattern));
     }, $hostPatterns);
     // we need to reset trusted hosts on trusted host patterns change
     self::$trustedHosts = array();
 }
コード例 #2
0
ファイル: Request.php プロジェクト: lenninsanchez/donadores
 /**
  * Sets a list of trusted host patterns.
  *
  * You should only list the hosts you manage using regexs.
  *
  * @param array $hostPatterns A list of trusted host patterns
  */
 public static function setTrustedHosts(array $hostPatterns)
 {
     self::$trustedHostPatterns = array_map(function ($hostPattern) {
         return sprintf('#%s#i', $hostPattern);
     }, $hostPatterns);
     // we need to reset trusted hosts on trusted host patterns change
     self::$trustedHosts = array();
 }