Skip to content
Snippets Groups Projects
Commit 3b1dfc83 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Added HTTP check for data directory security

The ?do

darcs-hash:20090114174724-7ad00-cc45b798d930b7e87c3c820925982fb8201cf7f4.gz
parent 528ddc7c
No related branches found
No related tags found
No related merge requests found
order allow,deny
deny from all
order allow,deny
deny from all
data directory
......@@ -200,6 +200,23 @@ function check(){
}else{
msg('The current page is not writable by you',0);
}
require_once(DOKU_INC.'inc/HTTPClient.php');
$check = wl('','',true).'data/_dummy';
$http = new DokuHTTPClient();
$http->timeout = 6;
$res = $http->get($check);
if(strpos($res,'data directory') !== false){
msg('It seems like the data directory is accessible from the web.
Make sure this directory is properly protected
(See <a href="http://www.dokuwiki.org/security">security</a>)',-1);
}elseif($http->status == 404 || $http->status == 403){
msg('The data directory seems to be properly protected',1);
}else{
msg('Failed to check if the data directory is accessible from the web.
Make sure this directory is properly protected
(See <a href="http://www.dokuwiki.org/security">security</a>)',-1);
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment