From 100a97e3f1501dd634d1e398f564902dcaf2b3fb Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Mon, 25 Sep 2006 22:10:52 +0200
Subject: =?UTF-8?q?remove=20metadebug=20again,=20improve=20do=DEbug=20inst?=
=?UTF-8?q?ead?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This adds the complete $INFO array (contains the metadata) to the usual
debug output and removes the metadebug parameter again.
darcs-hash:20060925201052-7ad00-c9a15b921466803b3f2bd50b0d72211cf68658c5.gz
---
doku.php | 9 +++------
inc/html.php | 12 +++++++++++-
inc/infoutils.php | 19 -------------------
3 files changed, 14 insertions(+), 26 deletions(-)
diff --git a/doku.php b/doku.php
index 74ba1db6f..34e95ccbe 100644
--- a/doku.php
+++ b/doku.php
@@ -46,15 +46,15 @@
//set default #FIXME not needed here? done in actions?
if(empty($ACT)) $ACT = 'show';
+ //make infos about the selected page available
+ $INFO = pageinfo();
+ // handle debugging
if($conf['allowdebug'] && $ACT == 'debug'){
html_debug();
exit;
}
- //make infos about the selected page available
- $INFO = pageinfo();
-
//send 404 for missing pages if configured
if($conf['send404'] && !$INFO['exists']){
header('HTTP/1.0 404 Not Found');
@@ -76,8 +76,5 @@
trigger_event('DOKUWIKI_DONE', $tmp=array());
- //handle metadebug request
- debug_meta($ID);
-
// xdebug_dump_function_profile(1);
?>
diff --git a/inc/html.php b/inc/html.php
index 25478c280..793a0d08f 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1170,11 +1170,17 @@ function html_debug(){
global $conf;
global $lang;
global $auth;
+ global $INFO;
+
//remove sensitive data
$cnf = $conf;
$cnf['auth']='***';
$cnf['notify']='***';
$cnf['ftp']='***';
+ $nfo = $INFO;
+ $nfo['userinfo'] = '***';
+ $ses = $_SESSION;
+ $ses[$conf['title']]['auth'] = '***';
print '';
@@ -1182,6 +1188,10 @@ function html_debug(){
print 'output as a mail to andi@splitbrain.org ';
print 'The best way to do this is to save this page in your browser
';
+ print '$INFO:';
+ print_r($nfo);
+ print '
';
+
print '$_SERVER:';
print_r($_SERVER);
print '
';
@@ -1221,7 +1231,7 @@ function html_debug(){
}
print '$_SESSION:';
- print_r($_SESSION);
+ print_r($ses);
print '
';
print 'Environment:';
diff --git a/inc/infoutils.php b/inc/infoutils.php
index ab8bc8deb..3c7ba96a5 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -247,22 +247,3 @@ function dbglog($msg){
}
}
-/**
- * Prints the metadata of a given page
- *
- * Only prints when debugging is allowed and the metadebug request
- * parameter is set
- *
- * The data is dumped after tpl_action and thus after the template's
- * closing html tag. This makes the HTML invalid, but this is for
- * debugging only anyway.
- *
- * @author Andreas Gohr
- */
-function debug_meta($id){
- global $conf;
- if(!$conf['allowdebug']) return;
- if(!$_REQUEST['metadebug']) return;
-
- dbg(p_get_metadata($id));
-}
--
cgit v1.2.3