summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/inc/actions.php b/inc/actions.php
index d4bd5b20e..f65b47451 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -64,11 +64,11 @@ function act_dispatch(){
//sitemap
if ($ACT == 'sitemap'){
- $ACT = act_sitemap($ACT);
+ act_sitemap($ACT);
}
//register
- if($ACT == 'register' && $_POST['save'] && register()){
+ if($ACT == 'register' && $INPUT->post->bool('save') && register()){
$ACT = 'login';
}
@@ -137,6 +137,7 @@ function act_dispatch(){
if (in_array($page, $pluginlist)) {
// attempt to load the plugin
if ($plugin =& plugin_load('admin',$page) !== null){
+ /** @var DokuWiki_Admin_Plugin $plugin */
if($plugin->forAdminOnly() && !$INFO['isadmin']){
// a manager tried to load a plugin that's for admins only
$INPUT->remove('page');
@@ -177,6 +178,11 @@ function act_dispatch(){
// in function tpl_content()
}
+/**
+ * Send the given headers using header()
+ *
+ * @param array $headers The headers that shall be sent
+ */
function act_sendheaders($headers) {
foreach ($headers as $hdr) header($hdr);
}
@@ -437,6 +443,11 @@ function act_redirect($id,$preact){
trigger_event('ACTION_SHOW_REDIRECT',$opts,'act_redirect_execute');
}
+/**
+ * Execute the redirect
+ *
+ * @param array $opts id and fragment for the redirect
+ */
function act_redirect_execute($opts){
$go = wl($opts['id'],'',true);
if(isset($opts['fragment'])) $go .= '#'.$opts['fragment'];
@@ -568,12 +579,10 @@ function act_export($act){
$output = rawWiki($ID,$REV);
break;
case 'xhtml':
- $pre .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' . DOKU_LF;
- $pre .= ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . DOKU_LF;
- $pre .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$conf['lang'].'"' . DOKU_LF;
- $pre .= ' lang="'.$conf['lang'].'" dir="'.$lang['direction'].'">' . DOKU_LF;
+ $pre .= '<!DOCTYPE html>' . DOKU_LF;
+ $pre .= '<html lang="'.$conf['lang'].'" dir="'.$lang['direction'].'">' . DOKU_LF;
$pre .= '<head>' . DOKU_LF;
- $pre .= ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . DOKU_LF;
+ $pre .= ' <meta charset="utf-8" />' . DOKU_LF;
$pre .= ' <title>'.$ID.'</title>' . DOKU_LF;
// get metaheaders
@@ -639,7 +648,7 @@ function act_sitemap($act) {
}
$sitemap = Sitemapper::getFilePath();
- if(strrchr($sitemap, '.') === '.gz'){
+ if (Sitemapper::sitemapIsCompressed()) {
$mime = 'application/x-gzip';
}else{
$mime = 'application/xml; charset=utf-8';
@@ -653,7 +662,7 @@ function act_sitemap($act) {
if (is_readable($sitemap)) {
// Send headers
header('Content-Type: '.$mime);
- header('Content-Disposition: attachment; filename='.basename($sitemap));
+ header('Content-Disposition: attachment; filename='.utf8_basename($sitemap));
http_conditionalRequest(filemtime($sitemap));