Bug #81635 [NEW]: When curly braces are escaped, the back-slash isn't removed \{
| From: | shealavington at gmail dot com | Date: | Thu, 18 Nov 2021 11:06:06 +0000 |
| Subject: | Bug #81635 [NEW]: When curly braces are escaped, the back-slash isn't removed \{ | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-237839@lists.php.net to get a copy of this message | ||
From: shealavington at gmail dot com
Operating system: Windows 10
PHP version: 8.0.12
Package: *General Issues
Bug Type: Bug
Bug description:When curly braces are escaped, the back-slash isn't removed \{
Description:
------------
When curly braces are escaped within a string "", the back-slash isn't
removed \{. For example
"hello\{$foo}" is outputting hello\{bar}
instead of hello{bar}
Test script:
---------------
<?php
$foo = "bar";
$test_script = "hello\{$foo}"
//- Explanation output below.
echo "If \ is the escape character, why are the escaped characters and
the escape character both shown?<br>";
echo "Res: <b>c:\path\hello\{$foo}</b><br>";
echo "Expected:
<b>c:\path\hello"."{"."$foo}</b><br>";
echo "<br>Notice how in this example, I haven't used a \ but the
{}
characters are gone when not escaped?<br>";
echo "Res: <b>c:\path\hello{$foo}</b><br>";
echo "<br>If I use \ n, it replaces the \, I don't see
\ n like I
do in the first example above.<br>";
echo "Res: <b>c:\path\hello\note\{$foo}</b><br>";
Expected result:
----------------
hello{bar}
Actual result:
--------------
hello\{bar}
--
Edit bug report at https://bugs.php.net/bug.php?id=81635&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81635&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81635&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81635&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81635&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81635&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81635&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81635&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81635&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81635&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81635&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81635&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81635&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81635&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81635&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81635&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81635&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81635&r=mysqlcfg