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

[REG 6.8.0 -> 6.8.1] QUrl::adjusted(NormalizePathSegments) can produce an invalid URL

    XMLWordPrintable

Details

    • Linux/X11
    • 7d05f5ed7 (dev), 86597d289 (6.9), 09f047079 (6.8)

    Description

      With Qt 6.8.1, the following code

      auto url = QUrl::fromUserInput(QStringLiteral("/tmp/..///asdf/"));
      auto adjusted = url.adjusted(QUrl::NormalizePathSegments);
      qCritical() << url << adjusted;
      

      prints
      QUrl("file:///tmp/..///asdf/") QUrl("")

      With Qt 5.15.16 (and, as far as I know, with Qt 6.8.0), the same code prints
      QUrl("file:///tmp/..///asdf/") QUrl("file:///asdf/")

      Qt Test prints more information about the invalid URL:
      Invalid URL: Path component starts with '//' and authority is absent; source was "//asdf/"; scheme = "file", path = "//asdf/"

      This regression causes a failure of KDevelop's TestPath unit test, but I am not aware of any problems for non-test code.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            vedg Igor Kushnir
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes