diff options
Diffstat (limited to 'library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php')
-rw-r--r-- | library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php b/library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php new file mode 100644 index 0000000..ef9f2d4 --- /dev/null +++ b/library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php @@ -0,0 +1,20 @@ +<?php + +namespace Icinga\Module\Director\Data\PropertiesFilter; + +class ArrayCustomVariablesFilter extends CustomVariablesFilter +{ + public function match($type, $name, $object = null) + { + return parent::match($type, $name, $object) + && $object !== null + && isset($object->datatype) + && ( + preg_match('/DataTypeArray[\w]*$/', $object->datatype) + || ( + preg_match('/DataTypeDatalist$/', $object->datatype) + && $object->format === 'json' + ) + ); + } +} |