summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-02-16 10:51:06 -0800
committerAndreas Gohr <andi@splitbrain.org>2013-02-16 10:51:06 -0800
commit9bbf02e86e5c1181bbc288ce42f1937f309a7e79 (patch)
tree36b24f050c594984e6f2c4dcc93aba9c1be5c5f4
parentc70d6cee34ddc4be4dc136fe8421929100a13fd8 (diff)
parent25c4afb8d352fa02fddec2253b301c13d0cd3fb2 (diff)
downloadrpg-9bbf02e86e5c1181bbc288ce42f1937f309a7e79.tar.gz
rpg-9bbf02e86e5c1181bbc288ce42f1937f309a7e79.tar.bz2
Merge pull request #177 from splitbrain/FS#2111
FS#2111, improve security check
-rw-r--r--inc/html.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/inc/html.php b/inc/html.php
index ddaed2261..c2723bceb 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1636,11 +1636,16 @@ function html_admin(){
}
// data security check
- // @todo: could be checked and only displayed if $conf['savedir'] is under the web root
- echo '<a style="border:none; float:right;"
- href="http://www.dokuwiki.org/security#web_access_security">
- <img src="data/security.png" alt="Your data directory seems to be protected properly."
- onerror="this.parentNode.style.display=\'none\'" /></a>';
+ // simple check if the 'savedir' is relative and accessible when appended to DOKU_URL
+ // it verifies either:
+ // 'savedir' has been moved elsewhere, or
+ // has protection to prevent the webserver serving files from it
+ if (substr($conf['savedir'],0,2) == './'){
+ echo '<a style="border:none; float:right;"
+ href="http://www.dokuwiki.org/security#web_access_security">
+ <img src="'.DOKU_URL.$conf['savedir'].'/security.png" alt="Your data directory seems to be protected properly."
+ onerror="this.parentNode.style.display=\'none\'" /></a>';
+ }
print p_locale_xhtml('admin');