diff options
Diffstat (limited to 'inc/parser/code.php')
-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"); |