Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-8169

Parse CSS Regex accepts invalid code

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.0.4
    • 3.0.8-RC1
    • Styles
    • None

    Description

      Hi,

      In acp_styles.php the RegEx in the db_theme_data() function;

      @import url(["\'](.*)["\']);

      will match invalid code, e.g. @import url("common.css'); as well as empty declarations. An alternative would be;

      @import\s+url((["\'])(.+)\1);

      Obviously the 1 needs changing to a 2 in the $matches[1][$idx] str_replaces().

      I believe it would be a good idea to ad a note to the top of stylesheet.css such as;

      /*
      Please note that if you require the CSS to be parsed for template variables phpBB only supports the @import notation below (using single or double quotes);
      @import url("common.css");
      */

      Attachments

        Issue Links

          Activity

            People

              A_Jelly_Doughnut A_Jelly_Doughnut [X] (Inactive)
              Daz Daz [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: