diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-12-10 15:32:48 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-12-12 10:38:12 +0100 |
commit | 335b2f40a631f7188ab921d69289acaf31908c6e (patch) | |
tree | 144c2f7233a0b27b6cae5fc0a81f817b968770f1 /lib/private/eventsource.php | |
parent | 3084a52a970c83ca35135f490b9bcb06b9900867 (diff) | |
download | nextcloud-server-335b2f40a631f7188ab921d69289acaf31908c6e.tar.gz nextcloud-server-335b2f40a631f7188ab921d69289acaf31908c6e.zip |
Fixed download file from URL error messages
- L10N now converted to string to make them work with json_encode
- Added specific error message when server doesn't allow fopen on URLs
- Fixed client side to correctly show error message in a notification
- Added OCP\JSON::encode() method to encode JSON with support for the
OC_L10N_String values
Diffstat (limited to 'lib/private/eventsource.php')
-rw-r--r-- | lib/private/eventsource.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/eventsource.php b/lib/private/eventsource.php index a83084d9251..4df0bc2e7cd 100644 --- a/lib/private/eventsource.php +++ b/lib/private/eventsource.php @@ -64,13 +64,13 @@ class OC_EventSource{ } if($this->fallback) { $response='<script type="text/javascript">window.parent.OC.EventSource.fallBackCallBack(' - .$this->fallBackId.',"'.$type.'",'.json_encode($data).')</script>'.PHP_EOL; + .$this->fallBackId.',"' . $type . '",' . OCP\JSON::encode($data) . ')</script>' . PHP_EOL; echo $response; }else{ if($type) { - echo 'event: '.$type.PHP_EOL; + echo 'event: ' . $type.PHP_EOL; } - echo 'data: '.json_encode($data).PHP_EOL; + echo 'data: ' . OCP\JSON::encode($data) . PHP_EOL; } echo PHP_EOL; flush(); |