From 9d2e1be699d573eebda922cf67f030d3d2aa462d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 16 Feb 2013 18:29:20 +0100 Subject: introduced http_status() for sending HTTP status code FS#1698 It seems, some servers require a special Status: header for sending the HTTP status code from PHP (F)CGI to the server. This patch introduces a new function (adopted from CodeIgniter) for simplifying the status handling. --- inc/parser/code.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/code.php') diff --git a/inc/parser/code.php b/inc/parser/code.php index 21fb0dc3c..43d8d703f 100644 --- a/inc/parser/code.php +++ b/inc/parser/code.php @@ -43,7 +43,7 @@ class Doku_Renderer_code extends Doku_Renderer { * This should never be reached, if it is send a 404 */ function document_end() { - header("HTTP/1.0 404 Not Found"); + http_status(404); echo '404 - Not found'; exit; } -- cgit v1.2.3 From 2d3f0c1657bcc4c97b1629fae08661213d973d56 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 19 Apr 2013 11:42:41 +0200 Subject: strip specials from file name in codeblock downloads FS#2757 --- inc/parser/code.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/parser/code.php') diff --git a/inc/parser/code.php b/inc/parser/code.php index 43d8d703f..6e159b041 100644 --- a/inc/parser/code.php +++ b/inc/parser/code.php @@ -20,6 +20,7 @@ class Doku_Renderer_code extends Doku_Renderer { if(!$language) $language = 'txt'; if(!$filename) $filename = 'snippet.'.$language; $filename = utf8_basename($filename); + $filename = utf8_stripspecials($filename, '_'); if($this->_codeblock == $INPUT->str('codeblock')){ header("Content-Type: text/plain; charset=utf-8"); -- cgit v1.2.3