Skip to content

Commit

Permalink
YAML handler bug-fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikuolan committed Nov 22, 2023
1 parent a8779a7 commit e45a5b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/YAML.php
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ private function unescape($Value = '', $Style = '"')
'~(?<!\\\\)\\\\((?:\\\\{2})*)_~',
'~(?<!\\\\)\\\\((?:\\\\{2})*)L~',
'~(?<!\\\\)\\\\((?:\\\\{2})*)P~'
], ['#', "\0", "\7", "\x08", "\t", "\n", "\x0B", "\x0C", "\x0D", "\x1B", '"', '/', "\xC2\x85", "\xC2\xA0", "\xE2\x80\xA8", "\xE2\x80\xA9"], $Value);
], ['\1#', "\\1\0", "\\1\7", "\\1\x08", "\\1\t", "\\1\n", "\\1\x0B", "\\1\x0C", "\\1\x0D", "\\1\x1B", '\1"', '\1/', "\\1\xC2\x85", "\\1\xC2\xA0", "\\1\xE2\x80\xA8", "\\1\xE2\x80\xA9"], $Value);
$Value = preg_replace_callback('~(?<!\\\\)\\\\((?:\\\\{2})*)x([\dA-Fa-f]{2})~', function ($Captured) {
return ($Decoded = hex2bin($Captured[2])) === false ? $Captured[0] : $Captured[1] . $Decoded;
}, $Value);
Expand Down

0 comments on commit e45a5b6

Please sign in to comment.