Permalink
Browse files

BUGFIX More specific regex in Requirements->includeInHTML() to avoid …

…duplicating information by matching HTML5-style <header> tags instead of <head> (fixes #5640) (from r105667)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112500 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent cf4a722 commit 9c68b954fdc20d0f84c19d8ffce07f9afbe09de4 @chillu chillu committed Oct 15, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 core/Requirements.php
View
@@ -692,10 +692,10 @@ function includeInHTML($templateFile, $content) {
}
// Put CSS at the bottom of the head
- $content = preg_replace("/(<\/head[^>]*>)/i", $requirements . "\\1", $content);
+ $content = preg_replace("/(<\/head>)/i", $requirements . "\\1", $content);
} else {
- $content = preg_replace("/(<\/head[^>]*>)/i", $requirements . "\\1", $content);
- $content = preg_replace("/(<\/head[^>]*>)/i", $jsRequirements . "\\1", $content);
+ $content = preg_replace("/(<\/head>)/i", $requirements . "\\1", $content);
+ $content = preg_replace("/(<\/head>)/i", $jsRequirements . "\\1", $content);
}
}

0 comments on commit 9c68b95

Please sign in to comment.