mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG: ampersand escaping
This commit is contained in:
parent
07886c3e61
commit
2f16951634
@ -256,11 +256,11 @@ class RequirementsTest extends SapphireTest {
|
|||||||
$html = $backend->includeInHTML(false, self::$html_template);
|
$html = $backend->includeInHTML(false, self::$html_template);
|
||||||
|
|
||||||
/* Javascript has correct path */
|
/* Javascript has correct path */
|
||||||
$this->assertTrue((bool)preg_match('/src=".*\/RequirementsTest_a\.js\?m=\d\d+&test=1&test=2&test=3/', $html),
|
$this->assertTrue((bool)preg_match('/src=".*\/RequirementsTest_a\.js\?m=\d\d+&test=1&test=2&test=3/', $html),
|
||||||
'javascript has correct path');
|
'javascript has correct path');
|
||||||
|
|
||||||
/* CSS has correct path */
|
/* CSS has correct path */
|
||||||
$this->assertTrue((bool)preg_match('/href=".*\/RequirementsTest_a\.css\?m=\d\d+&test=1&test=2&test=3/',$html),
|
$this->assertTrue((bool)preg_match('/href=".*\/RequirementsTest_a\.css\?m=\d\d+&test=1&test=2&test=3/',$html),
|
||||||
'css has correct path');
|
'css has correct path');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,17 +363,17 @@ 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) {
|
||||||
|
@ -660,7 +660,7 @@ class Requirements_Backend {
|
|||||||
$this->process_combined_files();
|
$this->process_combined_files();
|
||||||
|
|
||||||
foreach(array_diff_key($this->javascript,$this->blocked) as $file => $dummy) {
|
foreach(array_diff_key($this->javascript,$this->blocked) as $file => $dummy) {
|
||||||
$path = $this->path_for_file($file);
|
$path = Convert::raw2xml($this->path_for_file($file));
|
||||||
if($path) {
|
if($path) {
|
||||||
$jsRequirements .= "<script type=\"text/javascript\" src=\"$path\"></script>\n";
|
$jsRequirements .= "<script type=\"text/javascript\" src=\"$path\"></script>\n";
|
||||||
}
|
}
|
||||||
@ -677,7 +677,7 @@ class Requirements_Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach(array_diff_key($this->css,$this->blocked) as $file => $params) {
|
foreach(array_diff_key($this->css,$this->blocked) as $file => $params) {
|
||||||
$path = $this->path_for_file($file);
|
$path = Convert::raw2xml($this->path_for_file($file));
|
||||||
if($path) {
|
if($path) {
|
||||||
$media = (isset($params['media']) && !empty($params['media']))
|
$media = (isset($params['media']) && !empty($params['media']))
|
||||||
? " media=\"{$params['media']}\"" : "";
|
? " media=\"{$params['media']}\"" : "";
|
||||||
|
Loading…
Reference in New Issue
Block a user