Ensure XPath for ConfigDaemon matches exactly one element (#1224)
This commit is contained in:
@@ -91,6 +91,9 @@ class ConfigDaemon
|
|||||||
$this->fullxml = $xml;
|
$this->fullxml = $xml;
|
||||||
$this->xpath = $xpath;
|
$this->xpath = $xpath;
|
||||||
$this->daemon = $this->fullxml->xpath($this->xpath);
|
$this->daemon = $this->fullxml->xpath($this->xpath);
|
||||||
|
if (count($this->daemon) !== 1) {
|
||||||
|
throw new Exception('XPath "' . $this->xpath . '" didn\'t return exactly one element');
|
||||||
|
}
|
||||||
$attributes = $this->daemon[0]->attributes();
|
$attributes = $this->daemon[0]->attributes();
|
||||||
if ($attributes['title'] != '') {
|
if ($attributes['title'] != '') {
|
||||||
$this->title = $this->parseContent((string)$attributes['title']);
|
$this->title = $this->parseContent((string)$attributes['title']);
|
||||||
|
|||||||
@@ -1702,7 +1702,7 @@ dovecot unix - n n - - pipe
|
|||||||
</include>
|
</include>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- postfix with dovecot -->
|
<!-- postfix with dovecot -->
|
||||||
<daemon name="postfix_dovecot"
|
<daemon name="postfix_dovecot" version="3"
|
||||||
title="Postfix 3 with dovecot" default="true">
|
title="Postfix 3 with dovecot" default="true">
|
||||||
<include>//service[@type='smtp']/general/commands[@index=1]
|
<include>//service[@type='smtp']/general/commands[@index=1]
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
Reference in New Issue
Block a user