Merge branch '1.3' of github.com:cakephp/cakephp into 1.3

This commit is contained in:
mark_story 2010-08-04 23:59:17 -04:00
commit d6e3c318cd
2 changed files with 41 additions and 5 deletions

View file

@ -208,6 +208,13 @@ class RssHelper extends XmlHelper {
foreach ($elements as $key => $val) {
$attrib = array();
$escape = true;
if (is_array($val) && isset($val['convertEntities'])) {
$escape = $val['convertEntities'];
unset($val['convertEntities']);
}
switch ($key) {
case 'pubDate' :
$val = $this->time($val);
@ -261,11 +268,6 @@ class RssHelper extends XmlHelper {
$val = null;
break;
}
$escape = true;
if (is_array($val) && isset($val['convertEntities'])) {
$escape = $val['convertEntities'];
unset($val['convertEntities']);
}
if (!is_null($val) && $escape) {
$val = h($val);
}

View file

@ -517,6 +517,40 @@ class RssHelperTest extends CakeTestCase {
'/item'
);
$this->assertTags($result, $expected);
$item = array(
'title' => 'Foo bar',
'link' => array(
'url' => 'http://example.com/foo?a=1&b=2',
'convertEntities' => false
),
'description' => array(
'value' => 'descriptive words',
'cdata' => true,
),
'pubDate' => '2008-05-31 12:00:00'
);
$result = $this->Rss->item(null, $item);
$expected = array(
'<item',
'<title',
'Foo bar',
'/title',
'<link',
'http://example.com/foo?a=1&amp;b=2',
'/link',
'<description',
'<![CDATA[descriptive words]]',
'/description',
'<pubDate',
date('r', strtotime('2008-05-31 12:00:00')),
'/pubDate',
'<guid',
'http://example.com/foo?a=1&amp;b=2',
'/guid',
'/item'
);
$this->assertTags($result, $expected);
}
/**