Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2283

Netbeans formats content in php strings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 10.0
    • None
    • php - Editor

    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.

       

      Attachments

        1. NETBEANS-2283.zip
          3 kB
          Alexander Schreiner

        Activity

          People

            Unassigned Unassigned
            alexanderschreiner@seobility Alexander Schreiner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: