1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/7260] Don't delete poll if one exists and editing user lacks permission
  [ticket/9646] Honor CSS comments in @import statements
This commit is contained in:
Andreas Fischer
2010-08-22 21:54:08 +02:00
2 changed files with 36 additions and 2 deletions

View File

@@ -2531,13 +2531,21 @@ parse_css_file = {PARSE_CSS_FILE}
// Match CSS imports
$matches = array();
preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches);
preg_match_all('/@import url\((["\'])(.*)\1\);/i', $stylesheet, $matches);
// remove commented stylesheets (very simple parser, allows only whitespace
// around an @import statement)
preg_match_all('#/\*\s*@import url\((["\'])(.*)\1\);\s\*/#i', $stylesheet, $commented);
$matches[2] = array_diff($matches[2], $commented[2]);
if (sizeof($matches))
{
foreach ($matches[0] as $idx => $match)
{
$stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
if (isset($matches[2][$idx]))
{
$stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[2][$idx]), $stylesheet);
}
}
}