mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 18:08:02 +02:00
xml tags must not include undeclared namespaces like: <link-entry:infolog
Reinstating "throw an exception on XML errors in eTemplates for easier fixing" This reverts commit 18b7d9311cec0a8d93524dcac2a20bd1b9a30466.
This commit is contained in:
parent
4b6551c5a3
commit
e54aebebca
@ -123,7 +123,7 @@ class Widget
|
|||||||
// read all attributes
|
// read all attributes
|
||||||
$this->set_attrs($reader);
|
$this->set_attrs($reader);
|
||||||
|
|
||||||
while($reader->read() && $reader->depth > $depth)
|
while(($ok=$reader->read()) && $reader->depth > $depth)
|
||||||
{
|
{
|
||||||
if ($reader->nodeType == XMLReader::ELEMENT && $reader->depth > $depth)
|
if ($reader->nodeType == XMLReader::ELEMENT && $reader->depth > $depth)
|
||||||
{
|
{
|
||||||
@ -135,6 +135,12 @@ class Widget
|
|||||||
$this->attrs[(string)$reader->name] = (string)$reader->value;
|
$this->attrs[(string)$reader->name] = (string)$reader->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// give a clear indication where the template error is
|
||||||
|
if (!$ok && ($error = libxml_get_last_error()))
|
||||||
|
{
|
||||||
|
$file = str_replace([EGW_SERVER_ROOT.'/', '//default/etemplates/'], '', $error->file);
|
||||||
|
throw new \Exception("Error passing XML file '$file' line $error->line: $error->message");
|
||||||
|
}
|
||||||
|
|
||||||
// Reset content as we leave
|
// Reset content as we leave
|
||||||
if($old_cont) {
|
if($old_cont) {
|
||||||
@ -156,6 +162,7 @@ class Widget
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
libxml_use_internal_errors(true);
|
||||||
$reader = new XMLReader();
|
$reader = new XMLReader();
|
||||||
if (!$reader->XML($xml))
|
if (!$reader->XML($xml))
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,8 @@ class HistoryLog extends Etemplate\Widget
|
|||||||
if(!is_array($type))
|
if(!is_array($type))
|
||||||
{
|
{
|
||||||
list($basetype) = explode('-',$type);
|
list($basetype) = explode('-',$type);
|
||||||
$widget = @self::factory($basetype, '<?xml version="1.0"?><'.$type.' type="'.$type.'"/>', $key);
|
list($tag) = explode(':', $type); // xml tags must not include undeclared namespaces like: <link-entry:infolog
|
||||||
|
$widget = @self::factory($basetype, '<?xml version="1.0"?><'.$tag.' type="'.$type.'"/>', $key);
|
||||||
$widget->id = $key;
|
$widget->id = $key;
|
||||||
$widget->attrs['type'] = $type;
|
$widget->attrs['type'] = $type;
|
||||||
$widget->type = $type;
|
$widget->type = $type;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user