Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
10.0
-
None
-
Product Version: Apache NetBeans IDE 10.0 (Build 20190122-unknown-revn)
Java: 1.8.0_151; Java HotSpot(TM) 64-Bit Server VM 25.151-b12
Runtime: Java(TM) SE Runtime Environment 1.8.0_151-b12
System: Windows 10 version 10.0 running on amd64; Cp1252; de_DE (nb)
User directory:C:\Users\AlexanderSchreiner\AppData\Roaming\NetBeans\10.0
Cache directory:
C:\Users\AlexanderSchreiner\AppData\Local\NetBeans\Cache\10.0Product Version: Apache NetBeans IDE 10.0 (Build 20190122-unknown-revn) Java: 1.8.0_151; Java HotSpot(TM) 64-Bit Server VM 25.151-b12 Runtime: Java(TM) SE Runtime Environment 1.8.0_151-b12 System: Windows 10 version 10.0 running on amd64; Cp1252; de_DE (nb) User directory:C:\Users\AlexanderSchreiner\AppData\Roaming\NetBeans\10.0 Cache directory: C:\Users\AlexanderSchreiner\AppData\Local\NetBeans\Cache\10.0
Description
NetBeans formats PHP string literal content. This can lead to bugs when using PHP functions like header (https://secure.php.net/manual/de/function.header.php).
Before:
header('Location: /some/dir?parameter=value');
After:
header('Location: /some/dir?parameter = value');
Expected:
header('Location: /some/dir?parameter=value');
Since spaces in URLs are encoded with %20, this will return an invalid URL and therefore a 404 Error!
Repro:
I somehow can't reproduce the bug on a regular basis. But it occurs in the worst times, like I mentioned above, when I try to use PHP functions like header().
I feel like it has a correlation with other formatting. When the file is already correctly formatted, i can't reproduce the bug. But in big files, let's say 150 to 300 lines, it occurs more often.