Skip to content

Commit

Permalink
Sec: Bad security test
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 14, 2015
1 parent 8064779 commit e3f3956
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions htdocs/public/test/test_arrays.php
Expand Up @@ -4,11 +4,14 @@


require '../../main.inc.php';
if ($_SERVER['HTTP_HOST'] != 'localhost')

if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
{
print "Page available only with url http://localhost/...";
print "Page available only frome remote address 127.0.0.1";
exit;
}


$usedolheader=0; // 1 = Test inside a dolibarr page, 0 = Use hard coded header


Expand Down
4 changes: 2 additions & 2 deletions htdocs/public/test/test_forms.php
Expand Up @@ -6,9 +6,9 @@
require '../../main.inc.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

if ($_SERVER['HTTP_HOST'] != 'localhost')
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
{
print "Page available only with url http://localhost/...";
print "Page available only frome remote address 127.0.0.1";
exit;
}

Expand Down

0 comments on commit e3f3956

Please sign in to comment.