summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/dokuwiki.php1
-rw-r--r--doku.php2
-rw-r--r--inc/common.php6
-rw-r--r--inc/parserutils.php6
-rw-r--r--lib/exe/detail.php3
5 files changed, 12 insertions, 6 deletions
diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php
index 87639ddd8..d12fb27fc 100644
--- a/conf/dokuwiki.php
+++ b/conf/dokuwiki.php
@@ -37,6 +37,7 @@ $conf['deaccent'] = 1; //convert accented chars to unaccented
$conf['useheading'] = 0; //use the first heading in a page as its name
$conf['refcheck'] = 1; //check for references before deleting media files
$conf['refshow'] = 0; //how many references should be shown, 5 is a good value
+$conf['allowdebug'] = 1; //make debug possible, disable after install! 0|1
/* Antispam Features */
diff --git a/doku.php b/doku.php
index ba4dac1fd..7913354f7 100644
--- a/doku.php
+++ b/doku.php
@@ -45,7 +45,7 @@
if(empty($ACT)) $ACT = 'show';
- if($ACT == 'debug'){
+ if($conf['allowdebug'] && $ACT == 'debug'){
html_debug();
exit;
}
diff --git a/inc/common.php b/inc/common.php
index e5ab385ca..531e11477 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1120,6 +1120,12 @@ function check(){
}else{
msg('mb_string extension not available - PHP only replacements will be used',0);
}
+
+ if($conf['allowdebug']){
+ msg('Debugging support is enabled. If you don\'t need it you should set $conf[\'allowdebug\'] = 0',-1);
+ }else{
+ msg('Debugging support is disabled',1);
+ }
msg('Your current permission for this page is '.$INFO['perm'],0);
diff --git a/inc/parserutils.php b/inc/parserutils.php
index ba8d8df36..7a263bf22 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -90,16 +90,16 @@ function p_cached_xhtml($file){
{
//well then use the cache
$parsed = io_readfile($cache);
- $parsed .= "\n<!-- cachefile $cache used -->\n";
+ if($conf['allowdebug']) $parsed .= "\n<!-- cachefile $cache used -->\n";
}else{
$parsed = p_render('xhtml', p_cached_instructions($file),$info); //try to use cached instructions
if($info['cache']){
io_saveFile($cache,$parsed); //save cachefile
- $parsed .= "\n<!-- no cachefile used, but created -->\n";
+ if($conf['allowdebug']) $parsed .= "\n<!-- no cachefile used, but created -->\n";
}else{
@unlink($cache); //try to delete cachefile
- $parsed .= "\n<!-- no cachefile used, caching forbidden -->\n";
+ if($conf['allowdebug']) $parsed .= "\n<!-- no cachefile used, caching forbidden -->\n";
}
}
diff --git a/lib/exe/detail.php b/lib/exe/detail.php
index 5d7de0119..a090039cb 100644
--- a/lib/exe/detail.php
+++ b/lib/exe/detail.php
@@ -14,8 +14,7 @@
$IMG = getID('media');
$ID = cleanID($_REQUEST['id']);
- //FIXME remove me later
- if($_REQUEST['debug']){
+ if($conf['allowdebug'] && $_REQUEST['debug']){
print '<pre>';
foreach(explode(' ','basedir userewrite baseurl useslash') as $x){
print '$'."conf['$x'] = '".$conf[$x]."';\n";