From 9f6eeb4d0ea7c0ba0b88af92d6725a00778e17ad Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Sun, 1 Jul 2012 18:29:54 +1200 Subject: [PATCH] FIX: insert javascript requirements before the first inline script. From http://open.silverstripe.org/ticket/6648. --- view/Requirements.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/view/Requirements.php b/view/Requirements.php index e7e8ab2fa..426f12862 100644 --- a/view/Requirements.php +++ b/view/Requirements.php @@ -695,9 +695,10 @@ class Requirements_Backend { // We put script tags into the body, for performance. // If your template already has script tags in the body, then we put our script // tags just before those. Otherwise, we put it at the bottom. - $p1 = strripos($content, ' $p2) { + $p1 = stripos($content, ']*>)/i", $jsRequirements . "\\1", $content);