Changed error reporting to DOM based HTML generation.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 24 Oct 2013 16:35:06 +0000 (16:35 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 24 Oct 2013 16:35:06 +0000 (16:35 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1749 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php

index 36cba2d0366b617bdac4e37b180428adc12e78ef..4b0dc5a9deef4460b15d8f39e250912daf53c2aa 100644 (file)
@@ -218,7 +218,9 @@ class WrBaseMap {
                        // append all elements in the XML
                        $json_features = array_merge($json_features, xml_to_json_features('<wrmap>' . $content . '</wrmap>'));
                } catch (Exception $e) {
-                       return '<div class="error">' . htmlspecialchars("Fehler beim Parsen der Landkarte: " . $e->getMessage()) . '</div>';
+                       $doc = new WrMapDOMDocument();
+                       $doc->appendElement('div', array('class' => 'error'))->appendText('Fehler beim Parsen der Landkarte: ' . $e->getMessage());
+                       return array($doc->saveHTML($doc->firstChild), 'markerType' => 'nowiki');
                }
 
                // create final geojson