From 9ea21c835ddb63dc392ef54878ce7131be188852 Mon Sep 17 00:00:00 2001 From: philipp Date: Sat, 28 Sep 2013 19:50:55 +0000 Subject: [PATCH] Fixed: Revision r1621 introduced a side effect: Empty or elements were incorrectly treated as having an error. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1626 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wrmap.body.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wrmap.body.php b/wrmap.body.php index ea36f8b..fd17f84 100644 --- a/wrmap.body.php +++ b/wrmap.body.php @@ -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 and 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 -- 2.39.5