| @@ 393-406 (lines=14) @@ | ||
| 390 | if (is_array($value_rules)) { |
|
| 391 | foreach ($value_rules as $value_rule=>$value) { |
|
| 392 | if (preg_match('/'.$value_rule.'/is', $attrib_val)) { |
|
| 393 | if ($value === false) { |
|
| 394 | unset($part->attributes[$attrib_key]); |
|
| 395 | if (!count($part->attributes)) { |
|
| 396 | if (isset($config["delete_emptied"][$part->nodeName])) { |
|
| 397 | // remove previous config |
|
| 398 | @array_pop($delete_stack); |
|
| 399 | array_push($delete_stack, Array("tag" => $part->nodeName, "delete" => true)); |
|
| 400 | unset($part); |
|
| 401 | } |
|
| 402 | break 3; |
|
| 403 | } |
|
| 404 | } else { |
|
| 405 | $part->attributes[$attrib_key] = preg_replace('/^'.$value_rule.'$/is', $value, $part->attributes[$attrib_key]); |
|
| 406 | } |
|
| 407 | } |
|
| 408 | } |
|
| 409 | } else |
|
| @@ 409-424 (lines=16) @@ | ||
| 406 | } |
|
| 407 | } |
|
| 408 | } |
|
| 409 | } else |
|
| 410 | if ($value_rules === false) { |
|
| 411 | unset($part->attributes[$attrib_key]); |
|
| 412 | if (!count($part->attributes)) { |
|
| 413 | if (isset($config["delete_emptied"][$part->nodeName])) { |
|
| 414 | // remove previous config |
|
| 415 | @array_pop($delete_stack); |
|
| 416 | array_push($delete_stack, Array("tag" => $part->nodeName, "delete" => true)); |
|
| 417 | unset($part); |
|
| 418 | } |
|
| 419 | break 2; |
|
| 420 | } |
|
| 421 | } else { |
|
| 422 | $part->attributes[preg_replace('/^'.$attrib_rule.'$/is', $value_rules, $attrib_key)] = $part->attributes[$attrib_key]; |
|
| 423 | unset($part->attributes[$attrib_key]); |
|
| 424 | } |
|
| 425 | } |
|
| 426 | } |
|
| 427 | } |
|