summaryrefslogtreecommitdiff
path: root/inc/parser/code.php
diff options
context:
space:
mode:
authorGuy Brand <gb@unistra.fr>2015-08-10 10:03:27 +0200
committerGuy Brand <gb@unistra.fr>2015-08-10 10:03:27 +0200
commit53a57d16b9c741bb44099fd93bf79efa06796341 (patch)
tree24a90a50afe9325926c8ebaa2ed90f9fa093e5b9 /inc/parser/code.php
parentcf6e6645c31a9f185cef3fb9452fb188882ede47 (diff)
parenta060d9973e7c1d5051f2cc426937881826e4972e (diff)
downloadrpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.gz
rpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.bz2
Merge branch master into stable
Diffstat (limited to 'inc/parser/code.php')
-rw-r--r--inc/parser/code.php5
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");