summaryrefslogtreecommitdiffstats
path: root/ajax
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-08-07 18:21:48 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-08-07 18:21:48 -0400
commit4be12df25c8b0890db84bcac687aa00b16e3108c (patch)
treee7d0a901c44ae7c05983c033623cf983cf51402c /ajax
parent8ee6670cadf887669f6663d4f556921a9fd66cbe (diff)
handle SimplePie issues when adding feed
Diffstat (limited to 'ajax')
-rw-r--r--ajax/createfeed.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/ajax/createfeed.php b/ajax/createfeed.php
index 1fe36f20a..db02a1723 100644
--- a/ajax/createfeed.php
+++ b/ajax/createfeed.php
@@ -10,6 +10,21 @@
*
*/
+register_shutdown_function("shutdown");
+
+/* handle the case of fatal error */
+function shutdown() {
+ $l = OC_L10N::get('news');
+ $error = error_get_last();
+ if($error['type'] & (E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR)) { //all fatal errors
+ if (strpos($error['message'], 'get_uri')) {
+ //handle a fatal error caused by a SimplePie bug (https://github.com/simplepie/simplepie/issues/214)
+ OCP\Util::writeLog('news','ajax/createfeed.php: Fatal error:' . $error['message'] , OCP\Util::ERROR);
+ exit();
+ }
+ }
+}
+
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('news');