Permalink
Browse files

Fixed README, comments and added check for '::1' host (IPv6 localhost…

… address)
  • Loading branch information...
1 parent 2671cf0 commit 80f48612bdf30d058f9ba3cfb7e360f7084d96d1 @cr0t committed Jan 25, 2011
Showing with 3 additions and 5 deletions.
  1. +1 −1 README.markdown
  2. +2 −4 XWebDebugRouter.php
View
@@ -40,7 +40,7 @@ main.php configuration file update:
'class'=>'XWebDebugRouter',
'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle',
'levels'=>'error, warning, trace, profile, info',
- 'allowedIPs'=>array('127.0.0.1','192.168.1.54'),
+ 'allowedIPs'=>array('127.0.0.1','::1','192.168.1.54','192\.168\.1[0-5]\.[0-9]{3}'),
),
),
),
View
@@ -31,7 +31,7 @@
* 'class'=>'XWebDebugRouter',
* 'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed',
* 'levels'=>'error, warning, trace, profile, info',
- * 'allowedIPs'=>array('127.0.0.1','192.168.1.54'),
+ * 'allowedIPs'=>array('127.0.0.1','192.168.1.54','192\.168\.1[0-5]\.[0-9]{3}'),
* ),
* ),
* [...]
@@ -50,8 +50,6 @@
* AllowedIPs be defined as a preg regexps ie: '192\.168\.1[0-5]\.[0-9]{3}'
*/
- //TODO: Need more comments (rus: Нужно больше комментариев к коду)
-
/**
* Helper class for array dumping.
*/
@@ -466,7 +464,7 @@ public function processLogs($logs)
foreach($this->allowedIPs as $pattern)
{
// if found any char other than [0-9] and dot, treat pattern as a regexp
- if(preg_match('/[^0-9\.]/', $pattern))
+ if(preg_match('/[^0-9:\.]/', $pattern))
{
if(preg_match('/'.$pattern.'/', $ip))
{

0 comments on commit 80f4861

Please sign in to comment.