From f0859d4bbcf66e7ac5c42aae828058a98fa6355e Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Thu, 28 Jun 2012 23:31:31 -0400 Subject: Input wrapper for html forms --- inc/parser/code.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/parser/code.php') diff --git a/inc/parser/code.php b/inc/parser/code.php index 4d94dcf4e..ff44a4e1e 100644 --- a/inc/parser/code.php +++ b/inc/parser/code.php @@ -16,11 +16,12 @@ class Doku_Renderer_code extends Doku_Renderer { * When the correct block was found it exits the script. */ function code($text, $language = NULL, $filename='' ) { + global $INPUT; if(!$language) $language = 'txt'; if(!$filename) $filename = 'snippet.'.$language; $filename = basename($filename); - if($this->_codeblock == $_REQUEST['codeblock']){ + if($this->_codeblock == $INPUT->str('codeblock')){ header("Content-Type: text/plain; charset=utf-8"); header("Content-Disposition: attachment; filename=$filename"); header("X-Robots-Tag: noindex"); -- cgit v1.2.3 From 3009a773c06e6e5d731c42b12ad82272f9706f03 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 28 Jul 2012 10:40:48 +0200 Subject: replaced use of basename() with utf8_basename() FS#2015 --- 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 ff44a4e1e..21fb0dc3c 100644 --- a/inc/parser/code.php +++ b/inc/parser/code.php @@ -19,7 +19,7 @@ class Doku_Renderer_code extends Doku_Renderer { global $INPUT; if(!$language) $language = 'txt'; if(!$filename) $filename = 'snippet.'.$language; - $filename = basename($filename); + $filename = utf8_basename($filename); if($this->_codeblock == $INPUT->str('codeblock')){ header("Content-Type: text/plain; charset=utf-8"); -- cgit v1.2.3