Unverified Commit 17ff6a56 authored by DrColossos's avatar DrColossos Committed by RoSk0
Browse files

220: Fix array traversal and output

parent ffaf65bd
......@@ -84,7 +84,9 @@ class DomStrReplace extends DomProcessBase {
'attribute' => [
'attribute_options' => NULL,
],
'element',
'element' => [
]
],
'search' => NULL,
'replace' => NULL,
......@@ -96,6 +98,45 @@ class DomStrReplace extends DomProcessBase {
"Configuration option '$option_name' is required."
);
}
if (!empty($possible_values) && !array_key_exists($this->configuration[$option_name], $possible_values)) {
throw new InvalidPluginDefinitionException(
$this->getPluginId(),
sprintf(
'Configuration option "%s" only accepts the following values: %s.',
$option_name,
implode(', ', $possible_values)
)
);
}
}
$mode = $this->configuration['mode'];
$mode_validation = $options_validation['mode'][$mode];
foreach ($mode_validation as $option_name => $possible_values) {
if (empty($this->configuration[$option_name])) {
throw new InvalidPluginDefinitionException(
$this->getPluginId(),
"Configuration option '$option_name' is required for mode '$mode'."
);
}
if (is_null($possible_values) && !in_array($this->configuration[$option_name], $possible_values)) {
throw new InvalidPluginDefinitionException(
$this->getPluginId(),
sprintf(
'Configuration option "%s" only accepts the following values: %s.',
$option_name,
implode(', ', $possible_values)
)
);
}
}
$mode_validation = $options_validation['mode'][$this->configuration['mode']];
foreach ($mode_validation as $option_name => $possible_values) {
if (empty($this->configuration[$option_name])) {
throw new InvalidPluginDefinitionException(
$this->getPluginId(),
"Configuration option '$option_name' is required for mode '$mode'."
);
}
if (!is_null($possible_values) && !in_array($this->configuration[$option_name], $possible_values)) {
throw new InvalidPluginDefinitionException(
$this->getPluginId(),
......
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