summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-01-29 09:20:55 +0100
committerSimon Rettberg2019-01-29 09:20:55 +0100
commit533a2964535bcae48eb30ded2edaa6dd6d2c321b (patch)
tree77821a23566e719c8aaf6d57b8184ccc99eeeac3
parent[statistics] Fix copypasta (diff)
downloadslx-admin-533a2964535bcae48eb30ded2edaa6dd6d2c321b.tar.gz
slx-admin-533a2964535bcae48eb30ded2edaa6dd6d2c321b.tar.xz
slx-admin-533a2964535bcae48eb30ded2edaa6dd6d2c321b.zip
[locationinfo] Suppress XML parsing error spam
The SimpleXML constructor is quite verbose if you pass it e.g. an HTML error page instead of the expected XML. Suppress those errors, we'll do our own (more concise) logging in the exception handler.
-rw-r--r--modules-available/locationinfo/inc/coursebackend.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php
index 1da0086a..dcd92f6f 100644
--- a/modules-available/locationinfo/inc/coursebackend.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend.inc.php
@@ -334,7 +334,7 @@ abstract class CourseBackend
{
$cleanresponse = preg_replace('/(<\/?)(\w+):([^>]*>)/', '$1$2$3', $response);
try {
- $xml = new SimpleXMLElement($cleanresponse);
+ $xml = @new SimpleXMLElement($cleanresponse); // This spams before throwing exception
} catch (Exception $e) {
$this->error = 'Could not parse reply as XML, got ' . get_class($e) . ': ' . $e->getMessage();
if (CONFIG_DEBUG) {