diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-09-27 14:08:37 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-09-27 14:08:37 +0200 |
commit | ece4159b488ee81a13b9122239c88d82ec1aa59c (patch) | |
tree | f17577ffb84346e84df0945fa92c6f5634c7df68 /inc/parser | |
parent | da9572711f54d13ce3c5506971154b0bc359723f (diff) | |
download | rpg-ece4159b488ee81a13b9122239c88d82ec1aa59c.tar.gz rpg-ece4159b488ee81a13b9122239c88d82ec1aa59c.tar.bz2 |
Send CRLF to Windows UAs for code blocks #863
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/code.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/parser/code.php b/inc/parser/code.php index 00b956c27..2353e0dfa 100644 --- a/inc/parser/code.php +++ b/inc/parser/code.php @@ -21,6 +21,11 @@ class Doku_Renderer_code extends Doku_Renderer { $filename = utf8_basename($filename); $filename = utf8_stripspecials($filename, '_'); + // send CRLF to Windows clients + if(strpos($INPUT->server->str('HTTP_USER_AGENT'), 'Windows') !== false) { + $text = str_replace("\n", "\r\n", $text); + } + if($this->_codeblock == $INPUT->str('codeblock')) { header("Content-Type: text/plain; charset=utf-8"); header("Content-Disposition: attachment; filename=$filename"); |