diff options
author | Guy Brand <gb@unistra.fr> | 2012-09-10 17:04:45 +0200 |
---|---|---|
committer | Guy Brand <gb@unistra.fr> | 2012-09-10 17:04:45 +0200 |
commit | 0f8ac4e8c5872a6b68b350f96a9ecde0291edefa (patch) | |
tree | ad7938bb4143d5e5a38fd7a8d131e4171aec657d /doku.php | |
parent | 58ec8fa9128e4581749955de87530f432e387588 (diff) | |
parent | b31fcef02fd24b3e746c9618e77152c7b84c2f2a (diff) | |
download | rpg-0f8ac4e8c5872a6b68b350f96a9ecde0291edefa.tar.gz rpg-0f8ac4e8c5872a6b68b350f96a9ecde0291edefa.tar.bz2 |
Merge branch 'master' into stable
Diffstat (limited to 'doku.php')
-rw-r--r-- | doku.php | 58 |
1 files changed, 27 insertions, 31 deletions
@@ -4,20 +4,22 @@ * * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @author Andreas Gohr <andi@splitbrain.org> + * + * @global Input $INPUT */ // update message version -$updateVersion = 36.2; +$updateVersion = 37; // xdebug_start_profiling(); -if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/'); +if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__).'/'); -if (isset($_SERVER['HTTP_X_DOKUWIKI_DO'])){ +if(isset($_SERVER['HTTP_X_DOKUWIKI_DO'])) { $ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO'])); -} elseif (!empty($_REQUEST['idx'])) { +} elseif(!empty($_REQUEST['idx'])) { $ACT = 'index'; -} elseif (isset($_REQUEST['do'])) { +} elseif(isset($_REQUEST['do'])) { $ACT = $_REQUEST['do']; } else { $ACT = 'show'; @@ -27,29 +29,23 @@ if (isset($_SERVER['HTTP_X_DOKUWIKI_DO'])){ require_once(DOKU_INC.'inc/init.php'); //import variables -$_REQUEST['id'] = str_replace("\xC2\xAD",'',$_REQUEST['id']); //soft-hyphen -$QUERY = trim($_REQUEST['id']); -$ID = getID(); - -// deprecated 2011-01-14 -$NS = getNS($ID); - -$REV = $_REQUEST['rev']; -$IDX = $_REQUEST['idx']; -$DATE = $_REQUEST['date']; -$RANGE = $_REQUEST['range']; -$HIGH = $_REQUEST['s']; +$_REQUEST['id'] = str_replace("\xC2\xAD", '', $INPUT->str('id')); //soft-hyphen +$QUERY = trim($INPUT->str('id')); +$ID = getID(); + +$REV = $INPUT->int('rev'); +$IDX = $INPUT->str('idx'); +$DATE = $INPUT->int('date'); +$RANGE = $INPUT->str('range'); +$HIGH = $INPUT->param('s'); if(empty($HIGH)) $HIGH = getGoogleQuery(); -if (isset($_POST['wikitext'])) { - $TEXT = cleanText($_POST['wikitext']); +if($INPUT->post->has('wikitext')) { + $TEXT = cleanText($INPUT->post->str('wikitext')); } -$PRE = cleanText(substr($_POST['prefix'], 0, -1)); -$SUF = cleanText($_POST['suffix']); -$SUM = $_REQUEST['summary']; - -//sanitize revision -$REV = preg_replace('/[^0-9]/','',$REV); +$PRE = cleanText(substr($INPUT->post->str('prefix'), 0, -1)); +$SUF = cleanText($INPUT->post->str('suffix')); +$SUM = $INPUT->post->str('summary'); //make infos about the selected page available $INFO = pageinfo(); @@ -58,28 +54,28 @@ $INFO = pageinfo(); $JSINFO['id'] = $ID; $JSINFO['namespace'] = (string) $INFO['namespace']; - // handle debugging -if($conf['allowdebug'] && $ACT == 'debug'){ +if($conf['allowdebug'] && $ACT == 'debug') { html_debug(); exit; } //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_')) ){ + ($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) -if ($conf['breadcrumbs']) breadcrumbs(); +if($conf['breadcrumbs']) breadcrumbs(); // check upstream checkUpdateMessages(); $tmp = array(); // No event data -trigger_event('DOKUWIKI_STARTED',$tmp); +trigger_event('DOKUWIKI_STARTED', $tmp); //close session session_write_close(); |