From 565e2ab318f74d2c16f2f23ac7ca25b50438ee10 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 23 Dec 2011 16:33:45 +0100 Subject: [PATCH] Merge pull request #143 from Innovatif/sapphire --- BUGFIX Having
assertFileIncluded('css', array($basePath .'/RequirementsTest_b.css', $basePath .'/RequirementsTest_c.css')); Requirements::set_backend($holder); } + + function testJsWriteToBody() { + $backend = new Requirements_Backend(); + $backend->javascript('http://www.mydomain.com/test.js'); + + // Test matching with HTML5
tags as well + $template = '
My header

Body

'; + + $backend->set_write_js_to_body(false); + $html = $backend->includeInHTML(false, $template); + $this->assertContains('set_write_js_to_body(true); + $html = $backend->includeInHTML(false, $template); + $this->assertNotContains('assertContains('', $html); + + } } class RequirementsTest_Backend extends Requirements_Backend implements TestOnly { diff --git a/view/Requirements.php b/view/Requirements.php index 599091a57..30f889bc1 100644 --- a/view/Requirements.php +++ b/view/Requirements.php @@ -645,7 +645,7 @@ class Requirements_Backend { function includeInHTML($templateFile, $content) { if(isset($_GET['debug_profile'])) Profiler::mark("Requirements::includeInHTML"); - if(strpos($content, 'css || $this->javascript || $this->customCSS || $this->customScript || $this->customHeadTags)) { + if((strpos($content, '') !== false || strpos($content, 'css || $this->javascript || $this->customCSS || $this->customScript || $this->customHeadTags)) { $requirements = ''; $jsRequirements = '';