Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-16426

QUrl::removeAllQueryItems leaves a trailing query delimiter when removing the last query item

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0
    • 4.7.1
    • Core: URL Handling
    • None

    Description

      removeAllQueryItems leaves a trailing query delimiter (usually, the '&' character) when removing the last query item of an url. This is a problem since it will lead to empty query items accumulating at the end of the url.

      Example:

        QUrl url("http://example.com/?a=1&b=2");
        url.removeAllQueryItems("b");
        url.addQueryItem("b", "3");
        qDebug() << url; // QUrl( "http://example.com/?a=1&&b=3" )  <-- notice the two '&' characters
        //url.removeAllQueryItems(""); // Workaround: remove empty query items
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            gregschlom Gregory Schlomoff
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes