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


PHP ESAPI::getLogger方法代码示例

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


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

示例1: __construct

 function __construct()
 {
     $this->users = array();
     $this->logger = ESAPI::getLogger("Authenticator");
 }
开发者ID:neelaryan,项目名称:mutillidae,代码行数:5,代码来源:FileBasedAuthenticator.php

示例2: encodeForOS

 /**
  * @inheritdoc
  */
 public function encodeForOS($codec, $input)
 {
     if ($input === null) {
         return null;
     }
     if ($codec instanceof Codec == false) {
         ESAPI::getLogger('Encoder')->error(ESAPILogger::SECURITY, false, 'Invalid Argument, expected an instance of an OS Codec.');
         return null;
     }
     return $codec->encode($this->_immune_os, $input);
 }
开发者ID:najamelan,项目名称:PHP-ESAPI,代码行数:14,代码来源:DefaultEncoder.php

示例3: unlock

 /**
  * {@inheritDoc}
  */
 public function unlock()
 {
     $this->_locked = false;
     $this->_failedLoginCount = 0;
     ESAPI::getLogger("DefaultUser")->info(ESAPILogger::SECURITY, true, "Account unlocked: " . $this->getAccountName());
 }
开发者ID:najamelan,项目名称:PHP-ESAPI,代码行数:9,代码来源:DefaultUser.php

示例4: detectEncoding

 /**
  * Utility to detect a (potentially multibyte) string's encoding with 
  * extra logic to deal with single characters that mb_detect_encoding() fails 
  * upon.
  *
  * @param string $string string to examine
  * 
  * @return string returns detected encoding
  */
 public static function detectEncoding($string)
 {
     // detect encoding, special-handling for chr(172) and chr(128) to
     //chr(159) which fail to be detected by mb_detect_encoding()
     $is_single_byte = false;
     try {
         $bytes = unpack('C*', $string);
         if (is_array($bytes) && sizeof($bytes, 0) == 1) {
             $is_single_byte = true;
         }
     } catch (Exception $e) {
         // unreach?
         ESAPI::getLogger('Codec')->warning(DefaultLogger::SECURITY, false, 'Codec::detectEncoding threw an exception whilst attempting' . ' to unpack an input string', $e);
     }
     if ($is_single_byte === false) {
         // NoOp
     } else {
         if (ord($string) == 172 || ord($string) >= 128 && ord($string) <= 159) {
             // although these chars are beyond ASCII range, if encoding is
             // forced to ISO-8859-1 they will all encode to &#x31;
             return 'ASCII';
             //
         } else {
             if (ord($string) >= 160 && ord($string) <= 255) {
                 return 'ISO-8859-1';
             }
         }
     }
     // Strict encoding detection with fallback to non-strict detection.
     if (mb_detect_encoding($string, 'UTF-32', true)) {
         return 'UTF-32';
     } else {
         if (mb_detect_encoding($string, 'UTF-16', true)) {
             return 'UTF-16';
         } else {
             if (mb_detect_encoding($string, 'UTF-8', true)) {
                 return 'UTF-8';
             } else {
                 if (mb_detect_encoding($string, 'ISO-8859-1', true)) {
                     // To try an catch strings containing mixed encoding, search
                     // the string for chars of ordinal in the range 128 to 159 and
                     // 172 and don't return ISO-8859-1 if present.
                     $limit = mb_strlen($string, 'ISO-8859-1');
                     for ($i = 0; $i < $limit; $i++) {
                         $char = mb_substr($string, $i, 1, 'ISO-8859-1');
                         if (ord($char) == 172 || ord($char) >= 128 && ord($char) <= 159) {
                             return 'UTF-8';
                         }
                     }
                     return 'ISO-8859-1';
                 } else {
                     if (mb_detect_encoding($string, 'ASCII', true)) {
                         return 'ASCII';
                     } else {
                         return mb_detect_encoding($string);
                     }
                 }
             }
         }
     }
 }
开发者ID:AnvilStriker,项目名称:owasp-esapi-php,代码行数:70,代码来源:Codec.php

示例5: unlock

 /**
  * Unlock this user's account.
  */
 function unlock()
 {
     $this->_locked = FALSE;
     $this->_failedLoginCount = 0;
     ESAPI::getLogger("DefaultUser")->info(ESAPILogger::SECURITY, TRUE, "Account unlocked: " . $this->getAccountName());
 }
开发者ID:AnvilStriker,项目名称:owasp-esapi-php,代码行数:9,代码来源:DefaultUser.php

示例6: addBlacklistPattern

 /**
  * Adds a blacklist regex pattern to the array of blacklist patterns.
  * Inputs will be validated against each pattern.
  *
  * @param string $pattern Non-empty string blacklist regex pattern.
  *
  * @return does not return a value
  */
 public function addBlacklistPattern($pattern)
 {
     if (!is_string($pattern)) {
         throw new InvalidArgumentException('Validation misconfiguration - addBlacklistPattern expected ' . 'string $pattern');
     }
     if ($pattern == '') {
         ESAPI::getLogger()->warning(ESAPILogger::SECURITY, false, 'addBlacklistPattern received $pattern as an empty string.');
     }
     array_push($this->blacklistPatterns, $pattern);
 }
开发者ID:najamelan,项目名称:PHP-ESAPI,代码行数:18,代码来源:StringValidationRule.php


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