2005-01-12 21:24:54 +01:00
|
|
|
<?php
|
2005-01-14 17:40:57 +01:00
|
|
|
/**
|
|
|
|
* DokuWiki mainscript
|
|
|
|
*
|
|
|
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
|
|
|
* @author Andreas Gohr <andi@splitbrain.org>
|
|
|
|
*/
|
2005-02-19 11:20:55 +01:00
|
|
|
|
2005-04-29 22:54:36 +02:00
|
|
|
// xdebug_start_profiling();
|
2005-03-20 13:49:10 +01:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/');
|
|
|
|
require_once(DOKU_INC.'inc/init.php');
|
|
|
|
require_once(DOKU_INC.'inc/common.php');
|
|
|
|
require_once(DOKU_INC.'inc/events.php');
|
|
|
|
require_once(DOKU_INC.'inc/pageutils.php');
|
|
|
|
require_once(DOKU_INC.'inc/html.php');
|
|
|
|
require_once(DOKU_INC.'inc/auth.php');
|
|
|
|
require_once(DOKU_INC.'inc/actions.php');
|
|
|
|
|
|
|
|
//import variables
|
|
|
|
$QUERY = trim($_REQUEST['id']);
|
|
|
|
$ID = getID();
|
|
|
|
$NS = getNS($ID);
|
|
|
|
$REV = $_REQUEST['rev'];
|
|
|
|
$ACT = $_REQUEST['do'];
|
|
|
|
$IDX = $_REQUEST['idx'];
|
|
|
|
$DATE = $_REQUEST['date'];
|
|
|
|
$RANGE = $_REQUEST['lines'];
|
|
|
|
$HIGH = $_REQUEST['s'];
|
|
|
|
if(empty($HIGH)) $HIGH = getGoogleQuery();
|
|
|
|
|
|
|
|
$TEXT = cleanText($_POST['wikitext']);
|
|
|
|
$PRE = cleanText($_POST['prefix']);
|
|
|
|
$SUF = cleanText($_POST['suffix']);
|
|
|
|
$SUM = $_REQUEST['summary'];
|
|
|
|
|
|
|
|
//sanitize revision
|
|
|
|
$REV = preg_replace('/[^0-9]/','',$REV);
|
|
|
|
|
|
|
|
//we accept the do param as HTTP header, too:
|
|
|
|
if(!empty($_SERVER['HTTP_X_DOKUWIKI_DO'])){
|
2005-01-12 21:24:54 +01:00
|
|
|
$ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
|
2009-10-20 23:23:38 +02:00
|
|
|
}
|
2005-01-12 21:24:54 +01:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
if(!empty($IDX)) $ACT='index';
|
|
|
|
//set default #FIXME not needed here? done in actions?
|
|
|
|
if(empty($ACT)) $ACT = 'show';
|
2005-01-12 21:24:54 +01:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
//make infos about the selected page available
|
|
|
|
$INFO = pageinfo();
|
2005-01-12 21:24:54 +01:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
// handle debugging
|
|
|
|
if($conf['allowdebug'] && $ACT == 'debug'){
|
2005-01-12 21:24:54 +01:00
|
|
|
html_debug();
|
|
|
|
exit;
|
2009-10-20 23:23:38 +02:00
|
|
|
}
|
2006-02-17 23:20:40 +01:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
//send 404 for missing pages if configured or ID has special meaning to bots
|
|
|
|
if(!$INFO['exists'] &&
|
|
|
|
($conf['send404'] || preg_match('/^(robots\.txt|sitemap\.xml(\.gz)?|favicon\.ico|crossdomain\.xml)$/',$ID)) &&
|
|
|
|
($ACT == 'show' || substr($ACT,0,7) == 'export_') ){
|
2005-11-25 13:36:14 +01:00
|
|
|
header('HTTP/1.0 404 Not Found');
|
2009-10-20 23:23:38 +02:00
|
|
|
}
|
2005-11-25 13:36:14 +01:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
//prepare breadcrumbs (initialize a static var)
|
|
|
|
if ($conf['breadcrumbs']) breadcrumbs();
|
2005-06-08 23:35:14 +02:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
// check upstream
|
|
|
|
checkUpdateMessages();
|
2006-09-16 23:02:29 +02:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
trigger_event('DOKUWIKI_STARTED',$tmp=array());
|
2006-04-15 17:24:44 +02:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
//close session
|
|
|
|
session_write_close();
|
2005-06-08 23:35:14 +02:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
//do the work
|
|
|
|
act_dispatch($ACT);
|
2005-01-29 12:36:21 +01:00
|
|
|
|
2009-10-20 23:23:38 +02:00
|
|
|
trigger_event('DOKUWIKI_DONE', $tmp=array());
|
2006-04-15 17:24:44 +02:00
|
|
|
|
2005-04-29 22:54:36 +02:00
|
|
|
// xdebug_dump_function_profile(1);
|