Here's an updated fix for the problem with special chars (swedish chars: åäö, polish chars and so on). It's inspired from Raffee's fix (thanks!) but with the advantage that it also to store the XML the exakt same way as GetSimple does (with CDATA, safe_slash_html and so on). I borrowed most of it from the GetSimple core code.
Simply replace the function save_article with the following:
Note: If you add this patch, your old news will probably be unreadable since this format the XML in another way. You will have to resubmit them.
Simply replace the function save_article with the following:
Code:
/*******************************************************
* @function save_article
* @action write $_POST data to a file
*/
function save_article() {
$id = $_POST['id'];
$file = ARTICLEDATA . $id . '.xml';
if(isset($_POST['post-title'])) { $title = safe_slash_html($_POST['post-title']); }
if(isset($_POST['post-content'])) { $content = safe_slash_html($_POST['post-content']); }
if(isset($_POST['post-excerpt'])) { $excerpt = safe_slash_html($_POST['post-excerpt']); }
if (!file_exists($file)) {
$date = date('j M Y');
} else {
$data = @getXML($file);
$date = $data->date;
}
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>');
$note = $xml->addChild('title');
$note->addCData(empty($title) ? '(no title)' : $title);
$note = $xml->addChild('date');
$note->addCData($date);
$note = $xml->addChild('content');
$note->addCData($content);
$note = $xml->addChild('excerpt');
$note->addCData($excerpt);
exec_action('changedata-save');
XMLsave($xml, $file);
if (!is_writable($file))
echo '<div class="error">Unable to write article data to file</div>';
else
echo '<div class="updated">The article has been succesfully saved</div>';
article_overview();
}
Note: If you add this patch, your old news will probably be unreadable since this format the XML in another way. You will have to resubmit them.