mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Removed stray ampersand in Requirements (fixes #1809)
Only happens with suffix_requirements=true
This commit is contained in:
parent
caaf5a2d78
commit
cef955c8b9
@ -362,18 +362,18 @@ class RequirementsTest extends SapphireTest {
|
|||||||
|
|
||||||
$backend->set_suffix_requirements(true);
|
$backend->set_suffix_requirements(true);
|
||||||
$html = $backend->includeInHTML(false, $template);
|
$html = $backend->includeInHTML(false, $template);
|
||||||
$this->assertRegexp('/RequirementsTest_a\.js\?m=[\d]*/', $html);
|
$this->assertRegexp('/RequirementsTest_a\.js\?m=[\d]*"/', $html);
|
||||||
$this->assertRegexp('/RequirementsTest_b\.js\?m=[\d]*&foo=bar&bla=blubb/', $html);
|
$this->assertRegexp('/RequirementsTest_b\.js\?m=[\d]*&foo=bar&bla=blubb"/', $html);
|
||||||
$this->assertRegexp('/RequirementsTest_a\.css\?m=[\d]*/', $html);
|
$this->assertRegexp('/RequirementsTest_a\.css\?m=[\d]*"/', $html);
|
||||||
$this->assertRegexp('/RequirementsTest_b\.css\?m=[\d]*&foo=bar&bla=blubb/', $html);
|
$this->assertRegexp('/RequirementsTest_b\.css\?m=[\d]*&foo=bar&bla=blubb"/', $html);
|
||||||
|
|
||||||
$backend->set_suffix_requirements(false);
|
$backend->set_suffix_requirements(false);
|
||||||
$html = $backend->includeInHTML(false, $template);
|
$html = $backend->includeInHTML(false, $template);
|
||||||
$this->assertNotContains('RequirementsTest_a.js=', $html);
|
$this->assertNotContains('RequirementsTest_a.js=', $html);
|
||||||
$this->assertNotRegexp('/RequirementsTest_a\.js\?m=[\d]*/', $html);
|
$this->assertNotRegexp('/RequirementsTest_a\.js\?m=[\d]*"/', $html);
|
||||||
$this->assertNotRegexp('/RequirementsTest_b\.js\?m=[\d]*&foo=bar&bla=blubb/', $html);
|
$this->assertNotRegexp('/RequirementsTest_b\.js\?m=[\d]*&foo=bar&bla=blubb"/', $html);
|
||||||
$this->assertNotRegexp('/RequirementsTest_a\.css\?m=[\d]*/', $html);
|
$this->assertNotRegexp('/RequirementsTest_a\.css\?m=[\d]*"/', $html);
|
||||||
$this->assertNotRegexp('/RequirementsTest_b\.css\?m=[\d]*&foo=bar&bla=blubb/', $html);
|
$this->assertNotRegexp('/RequirementsTest_b\.css\?m=[\d]*&foo=bar&bla=blubb"/', $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assertFileIncluded($backend, $type, $files) {
|
public function assertFileIncluded($backend, $type, $files) {
|
||||||
|
@ -810,6 +810,8 @@ class Requirements_Backend {
|
|||||||
}
|
}
|
||||||
$suffix .= substr($fileOrUrl, strpos($fileOrUrl, '?')+1);
|
$suffix .= substr($fileOrUrl, strpos($fileOrUrl, '?')+1);
|
||||||
$fileOrUrl = substr($fileOrUrl, 0, strpos($fileOrUrl, '?'));
|
$fileOrUrl = substr($fileOrUrl, 0, strpos($fileOrUrl, '?'));
|
||||||
|
} else {
|
||||||
|
$suffix = '';
|
||||||
}
|
}
|
||||||
return "{$prefix}{$fileOrUrl}{$mtimesuffix}{$suffix}";
|
return "{$prefix}{$fileOrUrl}{$mtimesuffix}{$suffix}";
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user