]> ToastFreeware Gitweb - philipp/winterrodeln/mediawiki_extensions/wrmap.git/blobdiff - wrmap.body.php
Tagged output with 'nowiki' to prevent further processing.
[philipp/winterrodeln/mediawiki_extensions/wrmap.git] / wrmap.body.php
index ea36f8b371506dd11851dd0cb2d3d0c9afe14790..278333f9816ce4ac6d34df1709864821b311867c 100644 (file)
@@ -53,7 +53,8 @@ function sledruns_to_json_features() {
 function xml_to_json_features($input) {
        libxml_use_internal_errors(true); // without that, we get PHP Warnings if the $input is not well-formed
        $xml = new SimpleXMLElement($input); // input
-       if (!ctype_space((string) $xml)) { // there must not be anythin except sub-elements or whitespace
+       $whitespace = (string) $xml; // everything between <wrmap> and </wrmap> that's not a sub-element
+       if (strlen($whitespace) > 0 && !ctype_space($whitespace)) { // there must not be anythin except sub-elements or whitespace
                throw new Exception('Die Landkarte enthält folgenden ungültigen Text: "' . trim($xml) . '".');
        }
        $json_features = array(); // output
@@ -184,7 +185,7 @@ class WrBaseMap {
                $output .= htmlspecialchars($json_string, ENT_NOQUOTES);
                $output .= "</div>\n";
                
-               return $output;
+               return array($output, 'markerType' => 'nowiki');
        }
 }