Skip to content

Commit

Permalink
Merge branch '5.0' into 5.1
Browse files Browse the repository at this point in the history
* 5.0:
  [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
  [Mime] Keep Sender full address when used by non-SMTP transports
  Update MimeTypes.php
  • Loading branch information
fabpot committed Jul 15, 2020
2 parents e95ee8f + 2306321 commit cf63f06
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Definition/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class BaseNode implements NodeInterface
{
const DEFAULT_PATH_SEPARATOR = '.';

private static $placeholderUniquePrefix;
private static $placeholderUniquePrefixes = [];
private static $placeholders = [];

protected $name;
Expand Down Expand Up @@ -74,7 +74,7 @@ public static function setPlaceholder(string $placeholder, array $values): void
}

/**
* Sets a common prefix for dynamic placeholder values.
* Adds a common prefix for dynamic placeholder values.
*
* Matching configuration values will be skipped from being processed and are returned as is, thus preserving the
* placeholder. An exact match provided by {@see setPlaceholder()} might take precedence.
Expand All @@ -83,7 +83,7 @@ public static function setPlaceholder(string $placeholder, array $values): void
*/
public static function setPlaceholderUniquePrefix(string $prefix): void
{
self::$placeholderUniquePrefix = $prefix;
self::$placeholderUniquePrefixes[] = $prefix;
}

/**
Expand All @@ -93,7 +93,7 @@ public static function setPlaceholderUniquePrefix(string $prefix): void
*/
public static function resetPlaceholders(): void
{
self::$placeholderUniquePrefix = null;
self::$placeholderUniquePrefixes = [];
self::$placeholders = [];
}

Expand Down Expand Up @@ -543,8 +543,10 @@ private static function resolvePlaceholderValue($value)
return self::$placeholders[$value];
}

if (self::$placeholderUniquePrefix && 0 === strpos($value, self::$placeholderUniquePrefix)) {
return [];
foreach (self::$placeholderUniquePrefixes as $placeholderUniquePrefix) {
if (0 === strpos($value, $placeholderUniquePrefix)) {
return [];
}
}
}

Expand Down

0 comments on commit cf63f06

Please sign in to comment.