You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Definition/VariableNode.php
+15
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,19 @@ protected function validateType($value)
81
81
*/
82
82
protectedfunctionfinalizeValue($value)
83
83
{
84
+
// deny environment variables only when using custom validators
85
+
// this avoids ever passing an empty value to final validation closures
86
+
if (!$this->allowEmptyValue && $this->isHandlingPlaceholder() && $this->finalValidationClosures) {
87
+
@trigger_error(sprintf('Setting path "%s" to an environment variable is deprecated since Symfony 4.2. Remove "cannotBeEmpty()", "validate()" or include a prefix/suffix value instead.', $this->getPath()), E_USER_DEPRECATED);
88
+
// $e = new InvalidConfigurationException(sprintf('The path "%s" cannot contain an environment variable when empty values are not allowed by definition and are validated.', $this->getPath(), json_encode($value)));
89
+
// if ($hint = $this->getInfo()) {
90
+
// $e->addHint($hint);
91
+
// }
92
+
// $e->setPath($this->getPath());
93
+
//
94
+
// throw $e;
95
+
}
96
+
84
97
if (!$this->allowEmptyValue && $this->isValueEmpty($value)) {
85
98
$ex = newInvalidConfigurationException(sprintf('The path "%s" cannot contain an empty value, but got %s.', $this->getPath(), json_encode($value)));
86
99
if ($hint = $this->getInfo()) {
@@ -120,6 +133,8 @@ protected function mergeValues($leftSide, $rightSide)
* @expectedDeprecation Setting path "env_extension.scalar_node_not_empty_validated" to an environment variable is deprecated since Symfony 4.2. Remove "cannotBeEmpty()", "validate()" or include a prefix/suffix value instead.
0 commit comments