function forena_layout_form_validate in Forena Reports 6.2
Same name and namespace in other branches
- 6 forena.admin.inc \forena_layout_form_validate()
- 7 forena.admin.inc \forena_layout_form_validate()
- 7.2 forena.admin.inc \forena_layout_form_validate()
- 7.3 forena.admin.inc \forena_layout_form_validate()
File
- ./
forena.admin.inc, line 689
Code
function forena_layout_form_validate($form, &$form_state) {
$values = $form_state['values'];
$body = $values['body'];
$doc_prefix = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY nbsp " ">
]>';
if ($body) {
$body_doc = new DOMDocument('1.0', 'UTF-8');
$body_xml = $doc_prefix . '<html xmlns:frx="urn:FrxReports">' . $body . '</html>';
if (@$body_doc
->loadXML($body_xml) === FALSE) {
form_set_error('body', t('Invalid XHTML Document. Check for unclosed tags or stray &'));
}
}
}