API CHANGE Deprecated Text->EscapeXML(), use DBField->XML() instead

This commit is contained in:
Ingo Schommer 2012-01-31 13:39:19 +01:00
parent 618d767dcb
commit 6ecf7ffe84
2 changed files with 4 additions and 1 deletions

View File

@ -75,9 +75,12 @@ class Text extends StringField {
}
/**
* Return the value of the field with XML tags escaped.
*
* @deprecated 3.0 Use DBField->XML() instead.
* @return string
*/
function EscapeXML() {
Deprecation::notice('3.0', 'Use DBField->XML() instead.');
return str_replace(array('&','<','>','"'), array('&amp;','&lt;','&gt;','&quot;'), $this->value);
}

View File

@ -10,7 +10,7 @@
<item>
<title>$Title.XML</title>
<link>$AbsoluteLink</link>
<% if Description %><description>$Description.AbsoluteLinks.EscapeXML</description><% end_if %>
<% if Description %><description>$Description.AbsoluteLinks.XML</description><% end_if %>
<% if Date %><pubDate>$Date.Rfc822</pubDate>
<% else %><pubDate>$Created.Rfc822</pubDate><% end_if %>
<% if Author %><dc:creator>$Author.XML</dc:creator><% end_if %>