Merge remote-tracking branch 'refs/remotes/origin/master' into 2.5.0

pull/270/head
Joe Prochazka 2016-11-30 14:51:47 -05:00
commit f52f7caf10
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -138,7 +138,7 @@
// XML
$blogPosts = simplexml_load_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."blogPosts.xml");
foreach ($blogPosts->xpath("blogPost[title='".$originalTitle."']") as $blogPost) {
$blogPost->contents = $contents;
$blogPost->contents = html_entity_decode($contents, null, "UTF-8");
}
file_put_contents($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."blogPosts.xml", $blogPosts->asXML());
} else {
@ -162,6 +162,7 @@
$settings = new settings();
if ($settings::db_driver == "xml") {
// XML
$blogPosts = simplexml_load_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."blogPosts.xml");
foreach($blogPosts as $blogPost) {
if($blogPost->title == $title) {
@ -190,12 +191,13 @@
$settings = new settings();
if ($settings::db_driver == "xml") {
// XML
$blogPosts = simplexml_load_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."blogPosts.xml");
$blogPost = $blogPosts->addChild('blogPost', '');
$blogPost->addChild('title', $title);
$blogPost->addChild('date', gmdate('Y-m-d H:i:s', time()));
$blogPost->addChild('author', $author);
$blogPost->addChild('contents', $contents);
$blogPost->addChild('contents', html_entity_decode($contents, null, "UTF-8"));
$dom = dom_import_simplexml($blogPosts)->ownerDocument;
$dom->formatOutput = TRUE;
file_put_contents($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."blogPosts.xml", $dom->saveXML());