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