[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/akregator/src
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2010-02-07 12:03:01
Message-ID: 1265544181.349092.9928.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1086454 by osterfeld:

forwardport

SVN commit 1086321 by osterfeld:

strip HTML in titles, don't escape it.
BUG:211937

 M  +12 -9     articleformatter.cpp  


--- trunk/KDE/kdepim/akregator/src/articleformatter.cpp #1086453:1086454
@@ -101,9 +101,9 @@
         virtual bool visitFeed(Feed* node)
         {
             text = QString("<div class=\"headerbox\" \
                dir=\"%1\">\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr");
-
-            text += QString("<div class=\"headertitle\" \
                dir=\"%1\">").arg(Utils::directionOf(Utils::stripTags(node->title())));
                
-            text += node->title();
+            const QString strippedTitle = Utils::stripTags(node->title());
+            text += QString("<div class=\"headertitle\" \
dir=\"%1\">").arg(Utils::directionOf(strippedTitle)); +            text += \
strippedTitle;  if(node->unread() == 0)
                 text += i18n(" (no unread articles)");
             else
@@ -173,12 +173,13 @@
     text = QString("<div class=\"headerbox\" \
dir=\"%1\">\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr");  const QString \
enc = formatEnclosure( *article.enclosure() );  
-    if (!article.title().isEmpty())
+    const QString strippedTitle = Utils::stripTags( article.title() );
+    if (!strippedTitle.isEmpty())
     {
-        text += QString("<div class=\"headertitle\" \
dir=\"%1\">\n").arg(Utils::directionOf(Utils::stripTags(article.title()))); +        \
text += QString("<div class=\"headertitle\" \
dir=\"%1\">\n").arg(Utils::directionOf(strippedTitle));  if \
(article.link().isValid())  text += "<a href=\""+article.link().url()+"\">";
-        text += article.title().replace('<', "&lt;").replace('>', "&gt;"); // TODO: \
better leave things escaped in the parser +        text += strippedTitle;
         if (article.link().isValid())
             text += "</a>";
         text += "</div>\n";
@@ -367,12 +368,14 @@
     const QString enc = formatEnclosure( *article.enclosure() );
     text = QString("<div class=\"headerbox\" \
dir=\"%1\">\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr");  
-    if (!article.title().isEmpty())
+    const QString strippedTitle = Utils::stripTags( article.title() );
+
+    if (!strippedTitle.isEmpty())
     {
-        text += QString("<div class=\"headertitle\" \
dir=\"%1\">\n").arg(Utils::directionOf(Utils::stripTags(article.title()))); +        \
text += QString("<div class=\"headertitle\" \
dir=\"%1\">\n").arg(Utils::directionOf(strippedTitle));  if \
(article.link().isValid())  text += "<a href=\""+article.link().url()+"\">";
-        text += article.title().replace('<', "&lt;").replace('>', "&gt;"); // TODO: \
better leave things escaped in the parser +        text += strippedTitle;
         if (article.link().isValid())
             text += "</a>";
         text += "</div>\n";


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic