Changeset 218

Show
Ignore:
Timestamp:
25/02/07 13:01:18 (6 years ago)
Author:
dez
Message:

Switches to using tidy for the ATOM feed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • components/blogfeed.php

    r216 r218  
    8888                        $entrydate = ereg_replace(' ', 'T', $row['timestamp']).":00"; 
    8989                        $entries .= "\t<entry>\n"; 
    90                         $entries .= "\t\t<title>".$row['subject']."</title>\n"; 
     90                        $entries .= "\t\t<title>".htmlentities($row['subject'])."</title>\n"; 
    9191                        $entries .= "\t\t<link rel=\"alternate\" type=\"text/html\" href=\"".$user['link']."entry/".$row['shortsubject']."\"/>\n"; 
    9292                        $entries .= "\t\t<id>".$user['link']."entry/".$row['shortsubject']."</id>\n"; 
     
    9595                        $entries .= "\t\t<div xmlns=\"http://www.w3.org/1999/xhtml\">\n"; 
    9696                        //just passing though the raw body will cause the feed to fail if the code isnt valid, perhaps we should chuck everything though tidy on its way in (or even out) once we're on php5 
    97                         $entries .= "\t\t".str_replace("&","&amp;",html_entity_decode($row['body'],ENT_QUOTES,'UTF-8'))."\n"; 
     97                        $config = array('output-xhtml' => true, 'show-body-only' => true, 'wrap' => false); 
     98                        $tidy = new tidy; 
     99                        $tidy->parseString($row['body'], $config, 'utf8'); 
     100                        $tidy->cleanRepair(); 
     101                        $entries .= $tidy; 
    98102                        $entries .= "\t\t</div>\n"; 
    99103                        $entries .= "\t\t</content>\n";