mirror of
https://github.com/php/web-wiki.git
synced 2025-08-03 16:09:44 +00:00
Update dokuwiki to 2010-11-07a
This commit is contained in:
@ -6,77 +6,84 @@
|
||||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
*/
|
||||
|
||||
// update message version
|
||||
$updateVersion = 30;
|
||||
|
||||
// xdebug_start_profiling();
|
||||
|
||||
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');
|
||||
if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/');
|
||||
|
||||
//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'])){
|
||||
if (isset($_SERVER['HTTP_X_DOKUWIKI_DO'])){
|
||||
$ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
|
||||
}
|
||||
} elseif (!empty($_REQUEST['idx'])) {
|
||||
$ACT = 'index';
|
||||
} elseif (isset($_REQUEST['do'])) {
|
||||
$ACT = $_REQUEST['do'];
|
||||
} else {
|
||||
$ACT = 'show';
|
||||
}
|
||||
|
||||
if(!empty($IDX)) $ACT='index';
|
||||
//set default #FIXME not needed here? done in actions?
|
||||
if(empty($ACT)) $ACT = 'show';
|
||||
// load and initialize the core system
|
||||
require_once(DOKU_INC.'inc/init.php');
|
||||
|
||||
//make infos about the selected page available
|
||||
$INFO = pageinfo();
|
||||
//import variables
|
||||
$QUERY = trim($_REQUEST['id']);
|
||||
$ID = getID();
|
||||
$NS = getNS($ID);
|
||||
$REV = $_REQUEST['rev'];
|
||||
$IDX = $_REQUEST['idx'];
|
||||
$DATE = $_REQUEST['date'];
|
||||
$RANGE = $_REQUEST['range'];
|
||||
$HIGH = $_REQUEST['s'];
|
||||
if(empty($HIGH)) $HIGH = getGoogleQuery();
|
||||
|
||||
// handle debugging
|
||||
if($conf['allowdebug'] && $ACT == 'debug'){
|
||||
if (isset($_POST['wikitext'])) {
|
||||
$TEXT = cleanText($_POST['wikitext']);
|
||||
}
|
||||
$PRE = cleanText(substr($_POST['prefix'], 0, -1));
|
||||
$SUF = cleanText($_POST['suffix']);
|
||||
$SUM = $_REQUEST['summary'];
|
||||
|
||||
//sanitize revision
|
||||
$REV = preg_replace('/[^0-9]/','',$REV);
|
||||
|
||||
//make infos about the selected page available
|
||||
$INFO = pageinfo();
|
||||
|
||||
//export minimal infos to JS, plugins can add more
|
||||
$JSINFO['id'] = $ID;
|
||||
$JSINFO['namespace'] = (string) $INFO['namespace'];
|
||||
|
||||
|
||||
// handle debugging
|
||||
if($conf['allowdebug'] && $ACT == 'debug'){
|
||||
html_debug();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//send 404 for missing pages if configured
|
||||
if($conf['send404'] &&
|
||||
($ACT == 'show' || substr($ACT,0,7) == 'export_') &&
|
||||
!$INFO['exists']){
|
||||
//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' || (!is_array($ACT) && substr($ACT,0,7) == 'export_')) ){
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
}
|
||||
}
|
||||
|
||||
//prepare breadcrumbs (initialize a static var)
|
||||
breadcrumbs();
|
||||
//prepare breadcrumbs (initialize a static var)
|
||||
if ($conf['breadcrumbs']) breadcrumbs();
|
||||
|
||||
// check upstream
|
||||
checkUpdateMessages();
|
||||
// check upstream
|
||||
checkUpdateMessages();
|
||||
|
||||
trigger_event('DOKUWIKI_STARTED',$tmp=array());
|
||||
$tmp = array(); // No event data
|
||||
trigger_event('DOKUWIKI_STARTED',$tmp);
|
||||
|
||||
//close session
|
||||
session_write_close();
|
||||
//close session
|
||||
session_write_close();
|
||||
|
||||
//do the work
|
||||
act_dispatch($ACT);
|
||||
//do the work
|
||||
act_dispatch($ACT);
|
||||
|
||||
trigger_event('DOKUWIKI_DONE', $tmp=array());
|
||||
$tmp = array(); // No event data
|
||||
trigger_event('DOKUWIKI_DONE', $tmp);
|
||||
|
||||
// xdebug_dump_function_profile(1);
|
||||
?>
|
||||
|
Reference in New Issue
Block a user