Commit e75babc5 authored by Nigel McNie's avatar Nigel McNie
Browse files

Handle empty <content type="xhtml"> properly.


Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent dd060cc5
......@@ -58,6 +58,9 @@ class PluginImportLeap extends PluginImport {
const NS_CATEGORIES = 'http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories/';
const NS_MAHARA = 'http://wiki.mahara.org/Developer_Area/Import%2F%2FExport/LEAP_Extensions#';
const XHTML_DIV = '<div xmlns="http://www.w3.org/1999/xhtml">';
const XHTML_DIV_EMPTY = '<div xmlns="http://www.w3.org/1999/xhtml"/>';
public static function validate_import_data($importdata) {
}
......@@ -541,10 +544,13 @@ class PluginImportLeap extends PluginImport {
// to be "fixed" (turned back into browser-happy xhtml) if it
// causes problems.
$content = (string)$entry->content->div->asXML();
if (substr($content, 0, 42) == '<div xmlns="http://www.w3.org/1999/xhtml">') {
if (substr($content, 0, 42) == self::XHTML_DIV) {
$content = substr($content, 42, -6);
return $content;
}
else if (substr($content, 0, 43) == self::XHTML_DIV_EMPTY) {
return '';
}
}
log_debug("ERROR: <content> tag declared to be type xhtml but didn't wrap its content in a div with xmlns=http://www.w3.org/1999/xhtml");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment