Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Fixed README, comments and added check for '::1' host (IPv6 localhost…
Browse files Browse the repository at this point in the history
… address)
  • Loading branch information
cr0t committed Jan 25, 2011
1 parent 2671cf0 commit 80f4861
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Expand Up @@ -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}'),
),
),
),
Expand Down
6 changes: 2 additions & 4 deletions XWebDebugRouter.php
Expand Up @@ -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}'),
* ),
* ),
* [...]
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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))
{
Expand Down

0 comments on commit 80f4861

Please sign in to comment.