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

Parse CSS Regex accepts invalid code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.8-RC1
    • 3.0.4
    • Styles
    • None

      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");
      */

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

              Created:
              Updated:
              Resolved: