Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-5395

Invalid XHTML: inline JavaScript and CSS are ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.1
    • 3.0.RC3
    • Update system
    • None
    • PHP Environment: 5.2.3
      Database: MySQL 5.0.45

      When including inline JavaScript or CSS it should be included within a CDATA block, as in styles/prosilver/template/overall_header.html. However, most other files consistently comments out the JavaScript or CSS, which means that the inline content is ignored altogether when the files are interpreted as proper XHTML (using the XML parser, as Firefox does when the page is sent with the MIME type application/xhtml+xml).

      As long as phpBB uses the MIME type text/html (which it currently does), this is not noticeable. But it is not correct, and it does break the site when the MIME type is changed to reflect the actual contents. (The reason for my changing the MIME type is so that I can use MathML).

      Proposed solution: use CDATA everywhere, not only in overall_header.html and simple_header.html. The attached patch does this.

        1. inline_javascript_with_cdata.patch
          6 kB
          Christian von Schultz
        2. inline_javascript_with_cdata.patch
          25 kB
          Christian von Schultz
        3. inline_javascript_with_cdata.patch
          25 kB
          Christian von Schultz

            Acyd Burn Meik Sievertsen [X] (Inactive)
            christian von schultz christian von schultz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: