aboutsummaryrefslogtreecommitdiffstats
path: root/Server.php
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-04-11 15:04:41 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-04-11 15:04:41 +0200
commit71fc51bf32609a5a83b978998bc3c83659440b0d (patch)
tree787b6546197dc87b0922609282099038f3516a68 /Server.php
parent67f00490898b44cbc37a1587c3ed94b62b072280 (diff)
downloadEventsource-71fc51bf32609a5a83b978998bc3c83659440b0d.zip
Eventsource-71fc51bf32609a5a83b978998bc3c83659440b0d.tar.gz
Eventsource-71fc51bf32609a5a83b978998bc3c83659440b0d.tar.bz2
Update code. #performance
Diffstat (limited to 'Server.php')
-rw-r--r--Server.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/Server.php b/Server.php
index 8fe84d9..8f7a0c9 100644
--- a/Server.php
+++ b/Server.php
@@ -155,10 +155,9 @@ class Server {
$this->_event = null;
}
- $data = str_replace(CRLF, "\n", trim($data));
-
$this->_response->writeAll(
- 'data: ' . preg_replace("#(\n|\r)#", "\n" . 'data: >', $data)
+ 'data: ' .
+ preg_replace("#(" . CRLF . "|\n|\r)#", "\n" . 'data: >', $data)
);
if(null !== $id) {