summaryrefslogtreecommitdiffstats
path: root/lib/eventsource.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-30 00:34:36 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-30 00:34:36 +0200
commit7425efade78a04f20cb3cc83f964c6a00094b6ce (patch)
tree967aa50e8873c88f0adf6f91d0285ab1c54b7189 /lib/eventsource.php
parentb4a523927823ab8bc80c5f1fc0d5bd5ef61f8eb8 (diff)
parent7c6246fa451c4646dfaa1396dd37e0b3eb9706ba (diff)
downloadnextcloud-server-7425efade78a04f20cb3cc83f964c6a00094b6ce.tar.gz
nextcloud-server-7425efade78a04f20cb3cc83f964c6a00094b6ce.zip
Merge branch 'master' into oc_preview
Conflicts: 3rdparty lib/template.php
Diffstat (limited to 'lib/eventsource.php')
-rw-r--r--lib/eventsource.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/eventsource.php b/lib/eventsource.php
index 63f19792529..a83084d9251 100644
--- a/lib/eventsource.php
+++ b/lib/eventsource.php
@@ -25,7 +25,7 @@
* wrapper for server side events (http://en.wikipedia.org/wiki/Server-sent_events)
* includes a fallback for older browsers and IE
*
- * use server side events with causion, to many open requests can hang the server
+ * use server side events with caution, to many open requests can hang the server
*/
class OC_EventSource{
private $fallback;
@@ -43,6 +43,7 @@ class OC_EventSource{
header("Content-Type: text/event-stream");
}
if( !OC_Util::isCallRegistered()) {
+ $this->send('error', 'Possible CSRF attack. Connection will be closed.');
exit();
}
flush();
@@ -51,10 +52,10 @@ class OC_EventSource{
/**
* send a message to the client
- * @param string type
- * @param object data
+ * @param string $type
+ * @param mixed $data
*
- * if only one paramater is given, a typeless message will be send with that paramater as data
+ * if only one parameter is given, a typeless message will be send with that parameter as data
*/
public function send($type, $data=null) {
if(is_null($data)) {