Bug 94210 - HTML tags in article titles break layout
Summary: HTML tags in article titles break layout
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: cvs
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-01 11:21 UTC by Frank Osterfeld
Modified: 2004-12-01 20:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example file, see third item (18.27 KB, text/plain)
2004-12-01 11:24 UTC, Frank Osterfeld
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Osterfeld 2004-12-01 11:21:54 UTC
When an article title includes HTML, e.g. 
 
"QString::arg(): Argument missing: <div id="body">, 41" 
 
MyArticle.title() returns the string with resolved entities: 
 
"QString::arg(): Argument missing: <div id="body>, 41" 
 
This breaks the article formatting.
Comment 1 Frank Osterfeld 2004-12-01 11:24:31 UTC
Created attachment 8507 [details]
Example file, see third item

The file including the example. See third item, search the source for "Argument
missing".
Comment 2 Frank Osterfeld 2004-12-01 20:25:16 UTC
CVS commit by osterfeld: 

escape "<" and ">" in article titles
BUG: 94210


  M +1 -1      articleviewer.cpp   1.74


--- kdenonbeta/akregator/src/articleviewer.cpp  #1.73:1.74
@@ -194,5 +194,5 @@ QString ArticleViewer::formatArticle(Fee
         if (article.link().isValid())
             text += "<a id=\"titleanchor\" href=\""+article.link().url()+"\">";
-        text += article.title();
+        text += article.title().replace("<","&lt;").replace(">", "&gt;"); // TODO: better leave < and > escaped in the parser
         if (article.link().isValid())
             text += "</a>";