# HG changeset patch # User Nicholas Jillings # Date 1461944413 -3600 # Node ID ae69e61a6b761d236e6cd19a0778382f41395b3c # Parent 6897339ac651500afba2701dd6ec5c7338c0682c #46 PHP server now beautifies incoming XMLs. Could solve future #25 errors. diff -r 6897339ac651 -r ae69e61a6b76 php/save.php --- a/php/save.php Fri Apr 29 16:26:34 2016 +0100 +++ b/php/save.php Fri Apr 29 16:40:13 2016 +0100 @@ -5,6 +5,11 @@ $postText = file_get_contents('php://input'); $file_key = $_GET['key']; $filename = "../saves/save-".$file_key.".xml"; + $doc = new DOMDocument; + $doc->preserveWhiteSpace = false; + $doc->formatOutput = true; + $doc->loadXML($postText); + $postText = $doc->saveXML(); $fileHandle = fopen($filename, 'w'); if ($fileHandle == FALSE) {