Skip to content

Commit 20d565b

Browse files
authored
Revert most of the wrapping in _G logic until further testing
1 parent 62806b6 commit 20d565b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/XmlFileParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ private function childHasInterestingData(Frame $child): bool
193193

194194
private function wrapInGIfNeeded(string $name): string
195195
{
196-
if (!preg_match('/^[A-z][A-z0-9]*$/', $name)) {
197-
return '_G["' . str_replace('"', '\\"', $name) . '"]';
196+
if (str_contains($name, '$') || str_contains($name, '-')) {
197+
return '_G["' . $name . '"]';
198198
}
199199

200200
return $name;

0 commit comments

Comments
 (0)