[ss-2015-022]: XML escape RSSFeed $link parameter

This commit is contained in:
Ingo Schommer 2015-11-02 11:33:04 +13:00 committed by Damian Mooyman
parent 132e9b3e2f
commit 4f55b6a115
2 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,7 @@ class RSSFeed extends ViewableData {
private static $casting = array(
"Title" => "Varchar",
"Description" => "Varchar",
"Link" => "Varchar",
);
/**

View File

@ -43,6 +43,13 @@ class RSSFeedTest extends SapphireTest {
$this->assertContains('<description>ItemC AltContent</description>', $content);
}
public function testLinkEncoding() {
$list = new ArrayList();
$rssFeed = new RSSFeed($list, "http://www.example.com/?param1=true&param2=true", "Test RSS Feed");
$content = $rssFeed->outputToBrowser();
$this->assertContains('<link>http://www.example.com/?param1=true&amp;param2=true', $content);
}
public function testRSSFeedWithShortcode() {
$list = new ArrayList();
$list->push(new RSSFeedTest_ItemD());