Reputation: 1930
I want to expand the IP range that my $_SERVER['REMOTE_ADDR'
check for. This works:
$chk = "10.0.4.";
if( substr($_SERVER['REMOTE_ADDR'],0,strlen($chk)) !== $chk)
$wgGroupPermissions['*']['read'] = false;
The following opens up the world to the site:
$chk = "10.0.";
if( substr($_SERVER['REMOTE_ADDR'],0,strlen($chk)) !== $chk)
$wgGroupPermissions['*']['read'] = false;
I only want my local subnet 10.0.. to have read access to the site.
Upvotes: 0
Views: 406
Reputation: 65264
Remove the superfluous ,0
from the second line:
if( substr($_SERVER['REMOTE_ADDR'],0,strlen($chk)) !== $chk)
Upvotes: 0
Reputation: 798456
You have an extra argument in the second...
if (substr($_SERVER['REMOTE_ADDR'], 0, strlen($chk)) !== $chk)
Upvotes: 1