Fixed doubling of faked excerpt in rss/rdf mode

git-svn-id: http://svn.automattic.com/wordpress/trunk@91 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
mikelittle 2003-05-24 23:44:19 +00:00
parent 067c530196
commit 27d747b9b0

View File

@ -464,23 +464,23 @@ function the_excerpt() {
} }
function the_excerpt_rss($cut = 0, $encode_html = 0) { function the_excerpt_rss($cut = 0, $encode_html = 0) {
$excerpt = get_the_excerpt(true); $output = get_the_excerpt(true);
$excerpt = convert_bbcode($excerpt); $output = convert_bbcode($output);
$excerpt = convert_gmcode($excerpt); $output = convert_gmcode($output);
$excerpt = convert_chars($excerpt, 'unicode'); $output = convert_chars($output, 'unicode');
if ($cut && !$encode_html) { if ($cut && !$encode_html) {
$encode_html = 2; $encode_html = 2;
} }
if ($encode_html == 1) { if ($encode_html == 1) {
$excerpt = htmlspecialchars($excerpt); $output = htmlspecialchars($output);
$cut = 0; $cut = 0;
} elseif ($encode_html == 0) { } elseif ($encode_html == 0) {
$excerpt = make_url_footnote($excerpt); $output = make_url_footnote($output);
} elseif ($encode_html == 2) { } elseif ($encode_html == 2) {
$excerpt = strip_tags($excerpt); $output = strip_tags($output);
} }
if ($cut) { if ($cut) {
$blah = explode(' ', $excerpt); $blah = explode(' ', $output);
if (count($blah) > $cut) { if (count($blah) > $cut) {
$k = $cut; $k = $cut;
$use_dotdotdot = 1; $use_dotdotdot = 1;
@ -492,9 +492,9 @@ function the_excerpt_rss($cut = 0, $encode_html = 0) {
$excerpt .= $blah[$i].' '; $excerpt .= $blah[$i].' ';
} }
$excerpt .= ($use_dotdotdot) ? '...' : ''; $excerpt .= ($use_dotdotdot) ? '...' : '';
$excerpt = $excerpt; $output = $excerpt;
} }
echo $excerpt; echo $output;
} }
function the_excerpt_unicode() { function the_excerpt_unicode() {