PropertyModifier: add urlencode

fixes #1070
This commit is contained in:
Dirk Goetz 2017-11-24 10:29:41 +01:00 committed by Thomas Gelf
parent dbe8aeeed3
commit 777f5ff71a
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<?php
namespace Icinga\Module\Director\PropertyModifier;
use Icinga\Module\Director\Hook\PropertyModifierHook;
class PropertyModifierURLEncode extends PropertyModifierHook
{
public function getName()
{
return 'URL-encode a string';
}
public function transform($value)
{
return rawurlencode($value);
}
}

View File

@ -49,6 +49,7 @@ $this->provideHook('director/PropertyModifier', $prefix . 'PropertyModifier\\Pro
$this->provideHook('director/PropertyModifier', $prefix . 'PropertyModifier\\PropertyModifierArrayFilter');
$this->provideHook('director/PropertyModifier', $prefix . 'PropertyModifier\\PropertyModifierCombine');
$this->provideHook('director/PropertyModifier', $prefix . 'PropertyModifier\\PropertyModifierXlsNumericIp');
$this->provideHook('director/PropertyModifier', $prefix . 'PropertyModifier\\PropertyModifierURLEncode');
$this->provideHook('director/Job', $prefix . 'Job\\HousekeepingJob');
$this->provideHook('director/Job', $prefix . 'Job\\ConfigJob');