- // Strip last two lines off the file, because these contain a timestamp\r
- $sXml = substr($sXml, 0, strrpos($sXml,"\n"));\r
- $sXml = substr($sXml, 0, strrpos($sXml,"\n"));\r
+ //// Strip last two lines off the file, because these contain a timestamp\r
+ //$sXml = substr($sXml, 0, strrpos($sXml,"\n"));\r
+ //$sXml = substr($sXml, 0, strrpos($sXml,"\n"));\r
+\r
+ // If $sXml contains no line-breaks, pretty-ify the XML\r
+ if (strpos($sXml, "\n") !== true) {\r
+ $sXml = str_replace("?><posts ","?>\n<posts ", $sXml);\r
+ $sXml = str_replace("><post ",">\n <post ", $sXml);\r
+ $sXml = str_replace("></posts>",">\n</posts>", $sXml);\r
+ }\r