xref: /dokuwiki/doku.php (revision bc3b6aec0f5bdef988488010807a94bee0808426)
1<?php
2/**
3 * DokuWiki mainscript
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Andreas Gohr <andi@splitbrain.org>
7 */
8
9//  xdebug_start_profiling();
10
11  if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__)).'/');
12  require_once(DOKU_INC.'inc/init.php');
13  require_once(DOKU_INC.'inc/common.php');
14  require_once(DOKU_INC.'inc/pageutils.php');
15  require_once(DOKU_INC.'inc/html.php');
16  require_once(DOKU_INC.'inc/auth.php');
17  require_once(DOKU_INC.'inc/actions.php');
18
19  //import variables
20  $QUERY = trim($_REQUEST['id']);
21#  $ID    = cleanID($_REQUEST['id']);
22  $ID    = getID();
23  $REV   = $_REQUEST['rev'];
24  $ACT   = $_REQUEST['do'];
25  $IDX   = $_REQUEST['idx'];
26  $DATE  = $_REQUEST['date'];
27  $RANGE = $_REQUEST['lines'];
28  $HIGH  = $_REQUEST['s'];
29  if(empty($HIGH)) $HIGH = getGoogleQuery();
30
31  $TEXT  = cleanText($_POST['wikitext']);
32  $PRE   = cleanText($_POST['prefix']);
33  $SUF   = cleanText($_POST['suffix']);
34  $SUM   = $_REQUEST['summary'];
35
36  //sanitize revision
37  $REV = preg_replace('/[^0-9]/','',$REV);
38
39  //we accept the do param as HTTP header, too:
40  if(!empty($_SERVER['HTTP_X_DOKUWIKI_DO'])){
41    $ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
42  }
43
44  if(!empty($IDX)) $ACT='index';
45  //set default #FIXME not needed here? done in actions?
46  if(empty($ACT)) $ACT = 'show';
47
48
49  if($ACT == 'debug'){
50    html_debug();
51    exit;
52  }
53
54  //make infos about the selected page available
55  $INFO = pageinfo();
56
57  act_dispatch($ACT);
58
59  //restore old umask
60  umask($conf['oldumask']);
61
62//  xdebug_dump_function_profile(1);
63?>
64