Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.1
-
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