Unverified Commit 5c47458c authored by RoSk0's avatar RoSk0
Browse files

220: Fix options validation

parent 17ff6a56
......@@ -84,9 +84,7 @@ class DomStrReplace extends DomProcessBase {
'attribute' => [
'attribute_options' => NULL,
],
'element' => [
]
'element' => []
],
'search' => NULL,
'replace' => NULL,
......@@ -104,7 +102,7 @@ class DomStrReplace extends DomProcessBase {
sprintf(
'Configuration option "%s" only accepts the following values: %s.',
$option_name,
implode(', ', $possible_values)
implode(', ', array_keys($possible_values))
)
);
}
......@@ -118,7 +116,7 @@ class DomStrReplace extends DomProcessBase {
"Configuration option '$option_name' is required for mode '$mode'."
);
}
if (is_null($possible_values) && !in_array($this->configuration[$option_name], $possible_values)) {
if (!is_null($possible_values) && !in_array($this->configuration[$option_name], $possible_values)) {
throw new InvalidPluginDefinitionException(
$this->getPluginId(),
sprintf(
......
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