Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for unterminated entity references #13

Merged
merged 1 commit into from
Aug 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/phpGPX/Parsers/MetadataParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ public static function toXML(Metadata $metadata, \DOMDocument &$document)
$child = ExtensionParser::toXML($metadata->extensions, $document);
break;
default:
$child = $document->createElement($key, $metadata->{$attribute['name']});
$child = $document->createElement($key);
$elementText = $document->createTextNode((string) $metadata->{$attribute['name']});
$child->appendChild($elementText);
break;
}

Expand All @@ -155,4 +157,4 @@ public static function toXML(Metadata $metadata, \DOMDocument &$document)
return $node;
}

}
}
7 changes: 5 additions & 2 deletions src/phpGPX/Parsers/PointParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ public static function toXML(Point $point, \DOMDocument &$document)
$child = ExtensionParser::toXML($point->extensions, $document);
break;
default:
$child = $document->createElement($key, $point->{$attribute['name']});
$child = $document->createElement($key);
$elementText = $document->createTextNode((string) $point->{$attribute['name']});
$child->appendChild($elementText);
break;
break;
}

Expand Down Expand Up @@ -203,4 +206,4 @@ public static function toXMLArray(array $points, \DOMDocument &$document)
return $result;
}

}
}
6 changes: 4 additions & 2 deletions src/phpGPX/Parsers/RouteParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public static function toXML(Route $route, \DOMDocument &$document)
$child = PointParser::toXMLArray($route->points, $document);
break;
default:
$child = $document->createElement($key, $route->{$attribute['name']});
$child = $document->createElement($key);
$elementText = $document->createTextNode((string) $route->{$attribute['name']});
$child->appendChild($elementText);
break;
}

Expand Down Expand Up @@ -169,4 +171,4 @@ public static function toXMLArray(array $routes, \DOMDocument &$document)

return $result;
}
}
}
6 changes: 4 additions & 2 deletions src/phpGPX/Parsers/TrackParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public static function toXML(Track $track, \DOMDocument &$document)
$child = SegmentParser::toXMLArray($track->segments, $document);
break;
default:
$child = $document->createElement($key, $track->{$attribute['name']});
$child = $document->createElement($key);
$elementText = $document->createTextNode((string) $track->{$attribute['name']});
$child->appendChild($elementText);
break;
}

Expand Down Expand Up @@ -170,4 +172,4 @@ public static function toXMLArray(array $tracks, \DOMDocument &$document)

return $result;
}
}
}