Apply the filter to modify attributes.
Modify existing attributes with the configured values.
99 assert(
'is_array($request)');
100 assert(
'array_key_exists("Attributes", $request)');
106 if (empty($this->pattern) || empty($this->subject)) {
110 if (!$this->replace && !$this->
remove && $this->replacement ===
false) {
112 "'%remove' are set.");
115 if (!$this->replace && $this->replacement === null) {
119 if ($this->replace && $this->
remove) {
123 if (empty($this->target)) {
128 if ($this->subject !== $this->target && $this->
remove) {
132 if (!array_key_exists($this->subject,
$attributes)) {
137 if ($this->replace) {
140 if (preg_match($this->pattern, $value, $matches) > 0) {
141 $new_value = $matches[0];
143 if ($this->replacement !== FALSE) {
147 if ($this->subject === $this->target) {
154 } elseif ($this->
remove) {
155 $removedAttrs =
array();
158 if (preg_match($this->pattern, $value, $matches) > 0) {
159 $removedAttrs[] = $value;
168 if ($this->subject === $this->target) {
$target
Attribute to place the result in.
Create styles array
The data for the language used.
$subject
Attribute to search in.
$replacement
String to replace the pattern found with.