Bug 140419 - kftpgrabber doesn't handle ampersands correctly
Summary: kftpgrabber doesn't handle ampersands correctly
Status: RESOLVED FIXED
Alias: None
Product: kftpgrabber
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Jernej Kos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-22 03:33 UTC by Stavros M. Polymenakos
Modified: 2007-04-05 19:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stavros M. Polymenakos 2007-01-22 03:33:31 UTC
Version:           8.0 (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
OS:                Linux

Basically, if a file is in a saved queue and the name contains the '&' character it gets set to & in the saved file but when kftpgrabber reloads the queue, it reads it back as & after a few times the file name looks like & and because the file & doesn't exist on the server, the transfer fails unless manually fixed.

Reproduce:
On a server have a filename containing the & character, queue it and save the queue and load it back. For kicks do it it few times more and watch the amp;'s pile up. Broken parser?
Comment 1 Stavros M. Polymenakos 2007-01-22 03:35:39 UTC
oops 0.8.0 but as far as I remember this has always been, just haven't reported it until now.
Comment 2 Jernej Kos 2007-04-05 19:25:02 UTC
SVN commit 650882 by kostko:

Fixed URL encoding (= removed some ugly hacks).

BUG: 140419

 M  +2 -26     kftpqueueconverter.cpp  


--- trunk/extragear/network/kftpgrabber/src/kftpqueueconverter.cpp #650881:650882
@@ -101,37 +101,13 @@
 
 void KFTPQueueConverter::generateXML(KFTPQueue::Transfer *transfer, QDomNode parent)
 {
-  /*
-    <item>
-      <source>ftp://user:pass@ftp.server.org/path/to/file.gz</source>
-      <dest>file:/home/kostko/file.gz</dest>
-      <size>1234567890</size>
-      <type>file</type>
-    </item>
-  */
-  
   // Create the item
   QDomElement item = m_xml.createElement("item");
   parent.appendChild(item);
 
-  // XXX Dirty hack to properly convert chinese filenames
-  QString sourceUrl;
-  sourceUrl = transfer->getSourceUrl().htmlURL();
-  if (transfer->getSourceUrl().pass() != QString::null) {
-    sourceUrl = sourceUrl.insert(sourceUrl.find('@'), ":" + transfer->getSourceUrl().pass());
-  }
-
-  createTextNode("source", sourceUrl, item);
-
-  QString destUrl;
-  destUrl = transfer->getDestUrl().htmlURL();
-  if (transfer->getDestUrl().pass() != QString::null) {
-    destUrl = destUrl.insert(destUrl.find('@'), ":" + transfer->getDestUrl().pass());
-  }
-
-  createTextNode("dest", destUrl, item);
-  
   // Create text nodes
+  createTextNode("source", transfer->getSourceUrl().url(), item);
+  createTextNode("dest", transfer->getDestUrl().url(), item);
   createTextNode("size", QString::number(transfer->getSize()), item);
   createTextNode("type", transfer->isDir() ? "directory" : "file", item);