[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:22:35 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=0c3de7a

The following commit has been merged in the master branch:
commit 0c3de7a752fda4037c542406278a1e0e52adf1fc
Author: Сковорода Никита Андреевич <chalkerx at gmail.com>
Date:   Sun Sep 2 02:26:58 2012 +0400

    Fix URL escaping to the HTML view
    
    Insert URLs with double quotes rather than single quotes. These are escaped by the javascript
    handling in adium-theme-view.
    
    Reviewed-by: David Edmundson
---
 filters/images/images-filter.cpp | 8 ++++----
 lib/url-filter.cpp               | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/filters/images/images-filter.cpp b/filters/images/images-filter.cpp
index 09cf484..ee7d6a6 100644
--- a/filters/images/images-filter.cpp
+++ b/filters/images/images-filter.cpp
@@ -60,12 +60,12 @@ void ImagesFilter::filterMessage (Message& message)
         if (!fileName.isNull() && fileName.contains(d->imageRegex)) {
             QString href = QString::fromAscii(url.toEncoded());
             message.appendMessagePart(
-                QLatin1Literal("<br/><a href='") % href % QLatin1Literal("'>") %
-                    QLatin1Literal("<img src='") %
+                QLatin1Literal("<br/><a href=\"") % href % QLatin1Literal("\">") %
+                    QLatin1Literal("<img src=\"") %
                     href %
-                    QLatin1Literal("' style='max-width:100%;margin-top:3px' alt='") %
+                    QLatin1Literal("\" style=\"max-width:100%;margin-top:3px\" alt=\"") %
                     i18n("Click to view in browser") %
-                    QLatin1Literal("' />") %
+                    QLatin1Literal("\" />") %
                 QLatin1Literal("</a>")
             );
         }
diff --git a/lib/url-filter.cpp b/lib/url-filter.cpp
index a4ea8e0..162f992 100644
--- a/lib/url-filter.cpp
+++ b/lib/url-filter.cpp
@@ -42,11 +42,12 @@ void UrlFilter::filterMessage(Message &info) {
 
     int offset = 0;
     for (int i = 0; i < parsedUrl.fixedUrls.size(); i++) {
+         KUrl url(parsedUrl.fixedUrls.at(i));
          QString originalText = message.mid(parsedUrl.urlRanges.at(i).first + offset, parsedUrl.urlRanges.at(i).second);
-         QString link = QString::fromLatin1("<a href='%1'>%2</a>").arg(parsedUrl.fixedUrls.at(i), originalText);
+         QString link = QString::fromLatin1("<a href=\"%1\">%2</a>").arg(QString::fromAscii(url.toEncoded()), originalText);
          message.replace(parsedUrl.urlRanges.at(i).first + offset, parsedUrl.urlRanges.at(i).second, link);
 
-         urls.append(KUrl(parsedUrl.fixedUrls.at(i)));
+         urls.append(url);
 
          //after the first replacement is made, the original position values are not valid anymore, this adjusts them
          offset += link.length() - originalText.length();

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list