MantisBT - Doomseeker
View Issue Details
0002366Doomseeker[All Projects] Bugpublic2015-08-03 04:062018-09-29 14:24
Blzut3 
Zalewa 
urgentblockalways
closedfixed 
1.1 
1.11.1 
0002366: Wadseeker %WADNAME% broken
URLs using %WADNAME% appear to be handled differently with Qt5. This is due to URL percent encoding. The result is that the pattern is not replaced.

On a related note Mega-Dog noticed that filenames with '+' characters in them are not encoded properly. Probably should be replacing %WADNAME% with the filename passed through QUrl::toPercentEncoding().
No tags attached.
Issue History
2015-08-03 04:06Blzut3New Issue
2015-08-03 17:07ZalewaNote Added: 0013033
2015-08-03 17:07ZalewaAssigned To => Zalewa
2015-08-03 17:07ZalewaStatusnew => feedback
2015-08-03 20:21Blzut3Note Added: 0013036
2015-08-03 20:21Blzut3Statusfeedback => assigned
2015-08-04 05:31ZalewaNote Edited: 0013033bug_revision_view_page.php?bugnote_id=13033#r7800
2015-08-04 07:25Mega-DogNote Added: 0013041
2015-08-04 11:53ZalewaNote Added: 0013042
2015-08-04 11:58ZalewaNote Edited: 0013042bug_revision_view_page.php?bugnote_id=13042#r7802
2015-08-04 16:44ZalewaNote Edited: 0013042bug_revision_view_page.php?bugnote_id=13042#r7803
2015-08-04 18:03ZalewaNote Added: 0013046
2015-08-05 20:56ZalewaNote Added: 0013059
2015-08-05 20:56ZalewaStatusassigned => needs testing
2015-08-05 21:02ZalewaNote Edited: 0013059bug_revision_view_page.php?bugnote_id=13059#r7807
2015-08-05 21:07Blzut3Note Added: 0013060
2017-05-08 17:03ZalewaNote Added: 0017606
2017-05-08 17:03ZalewaStatusneeds testing => resolved
2017-05-08 17:03ZalewaFixed in Version => 1.1
2017-05-08 17:03ZalewaResolutionopen => fixed
2018-09-29 14:24WubTheCaptainStatusresolved => closed

Notes
(0013033)
Zalewa   
2015-08-03 17:07   
(edited on: 2015-08-04 05:31)
This should fix problem with %WADNAME% not being recognized properly:
'https://bitbucket.org/Blzut3/doomseeker/commits/72fd6cf23915f4d66a237b964539308af74a1d2a [^]'

I already uploaded new update to beta channel.

I also noticed that if you type non-printable character as percent encoded in the Wadseeker sites input box, Doomseeker will gladly accept such URL and display a placeholder character. You can, for example, insert \0 (%00), or BEL (%07). I'm not sure if we should be concerned with that.

I'm also unable to reproduce problem with '+' character. I prepared a simple test page, but Wadseeker seems to work correctly here:
'http://zalewa.strangled.net/wadseeker_test/test11.html [^]'

(0013036)
Blzut3   
2015-08-03 20:21   
Ahh, the issue is that if passed to a query (?whatever=blah+blah) then a plus sign is converted to a space. Thus URLs like dogsoft.net don't work with plus signs.

'http://stackoverflow.com/questions/1005676/urls-and-plus-signs [^]'
(0013041)
Mega-Dog   
2015-08-04 07:25   
My server has been set now so a conversion of %2B in the URL can pull the file. It will be outputted as the original filename.

I try and make my site comparable for both GetWad and Wadseeker.
(0013042)
Zalewa   
2015-08-04 11:53   
(edited on: 2015-08-04 16:44)
I've done some investigating and the problem isn't trivial. First of all, there are differences between Qt4 and Qt5 how QUrl behaves. Qt5 seems to be more compliant with what we want to achieve, but in the end I failed to achieve success with Qt4 and reverted my changes.

Moreover, there seem to be differences between platforms. For example, inserting %WADNAME% in sites configuration box will work properly on Windows, but on Ubuntu it inserts zDNAME% instead! This can be very simply fixed with using QString instead of QUrl in this box, which I'm about to commit.

I'll try to do some more investigating later, but I'm burned out for now.

EDIT:
And here's the commit:
'https://bitbucket.org/Blzut3/doomseeker/commits/140176c6ec78f8fa10ba4e3ccab01c45ce338fcc [^]'

(0013046)
Zalewa   
2015-08-04 18:03   
I've just deployed fix for %WADNAME% to beta update channel.
(0013059)
Zalewa   
2015-08-05 20:56   
(edited on: 2015-08-05 21:02)
Investigation into the '+' occurred and some serious bullshit in Qt4 was detected:
'https://www.youtube.com/watch?v=MLVmwYXsg20 [^]'

Passing '+' "as is" (without prior percent encoding to %2B) will just pass '+' literally in the URL and the server will interpret it as spacebar.
Passing '%2B' ('+' encoded) will cause double encoding as Qt will re-encode '%' and produce '%252B' as a result.

Frankly speaking, I don't care about getting this to work in Qt4 anymore. Perhaps it could be done by settings URL through setRawHeader() but I didn't bother to try. In Qt5 it works fine and since WAD names rarely go outside [alphanumeric_-] range I consider the problem fixed.

'https://bitbucket.org/Blzut3/doomseeker/commits/51c3ffa81aefe047d7335a03631ae17682782c0f [^]'

Anyway, new Windows build is on beta update channel, please test.

(0013060)
Blzut3   
2015-08-05 21:07   
I think that explains why the Qt5 behavior changed.

Yeah, totally fine with it only working in Qt5 builds. The number of wads out there with plus signs in their file name is pretty small I would hope.
(0017606)
Zalewa   
2017-05-08 17:03   
As there are no further problems reported I consider this as fixed in Doomseeker 1.1.