diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-02-11 09:27:16 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-02-11 09:27:16 +0100 |
commit | 76ec6b0ed2130a731913cb29e28886afae050b63 (patch) | |
tree | 80dff886d16ae17017a161fda5e32fbc806d4419 /inc/parser/code.php | |
parent | 9d37542fb0dc853c27db0ebfd9ec5817039d5f8b (diff) | |
parent | ece4159b488ee81a13b9122239c88d82ec1aa59c (diff) | |
download | rpg-76ec6b0ed2130a731913cb29e28886afae050b63.tar.gz rpg-76ec6b0ed2130a731913cb29e28886afae050b63.tar.bz2 |
Merge pull request #872 from splitbrain/bug863
Send CRLF to Windows UAs for code blocks #863
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"); |