Skip to content

HTML entities in javascript are not encoded #2

@taraghi

Description

@taraghi

For the case the javascript code generates DHTML, the HTML entities in code (such as input, textarea, buttons etc.) are not encoded. As a result they are shown as HTML elements.
I suggest to use "htmlspecialchars" function from phpjs.org 1 to solve this issue:

in the while loop:
list += "

  • " + keys[i] + "

    :
    " + htmlspecialchars(d[keys[i]]) + "
  • ";

    Regards, Beni

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions