|
@@ -111,7 +111,7 @@ discard block |
|
|
block discarded – undo |
|
111
|
111
|
foreach ($data as $k => $val) { |
|
112
|
112
|
if (!is_array($val)) { |
|
113
|
113
|
// Find the self referenced placeholders and fill them. |
|
114
|
|
- $data[$k] = preg_replace_callback('/@\[([a-zA-Z0-9_.-]*?)]/', function ($matches) { |
|
|
114
|
+ $data[$k] = preg_replace_callback('/@\[([a-zA-Z0-9_.-]*?)]/', function($matches) { |
|
115
|
115
|
// Does this key exist, is so fill this match, if not, just return the match intact. |
|
116
|
116
|
return $this->get($matches[1]) ?: $matches[0]; |
|
117
|
117
|
}, $val); |
|
@@ -122,7 +122,7 @@ discard block |
|
|
block discarded – undo |
|
122
|
122
|
} |
|
123
|
123
|
|
|
124
|
124
|
// Find the environment variable placeholders and fill them. |
|
125
|
|
- $data[$k] = preg_replace_callback('/\$\[([a-zA-Z0-9_.-]*?)]/', static function ($matches) { |
|
|
125
|
+ $data[$k] = preg_replace_callback('/\$\[([a-zA-Z0-9_.-]*?)]/', static function($matches) { |
|
126
|
126
|
// If locally set environment variable (variable not set by a SAPI) found, replace with it's value. |
|
127
|
127
|
if (!empty(getenv($matches[1], true))) { |
|
128
|
128
|
// Try local only environment variables first (variable not set by a SAPI) |
|
@@ -150,7 +150,7 @@ discard block |
|
|
block discarded – undo |
|
150
|
150
|
private function stringPlaceholderHandler(string $data): string |
|
151
|
151
|
{ |
|
152
|
152
|
// Find the self referenced placeholders and fill them. |
|
153
|
|
- return preg_replace_callback('/@\[([a-zA-Z0-9_.-]*?)]/', function ($matches) { |
|
|
153
|
+ return preg_replace_callback('/@\[([a-zA-Z0-9_.-]*?)]/', function($matches) { |
|
154
|
154
|
// Does this key exist, is so fill this match, if not, just return the match intact. |
|
155
|
155
|
$ret = $this->get($matches[1]) ?: $matches[0]; |
|
156
|
156
|
|