Use alternate directory character

Started by forsajt, April 26, 2015, 09:58:24 AM

Previous topic - Next topic

forsajt

For now, this option should be always checked if you want to avoid problems. If this option is unchecked, WebCopy replaces Unix directory separator with Windows one ("\") in links, which is unsafe, because it is used as escape character in JavaScript (paths are broken in jQuery for example). It should either be escaped (although I didn't test it) or this option should be removed at all. I hope Richard finds time to fix this one too.

Richard Moss

Hmm. The default always is unchecked - it always used to use Windows full stop, Unix style was only added due to user  request. Unless of course I broke it when refactoring in 1.0.10.0, that really does seem to be my biggest talent. Can't say I've noticed this before, however I'm slightly confused you're bringing JavaScript into this as WebCopy doesn't currently even look at JavaScript as it doesn't have a JS parser. (Not this release but next I want to start trying to handle basic "onclick window.location" type affairs and take it from there in very small steps.)

Do you have some form of example of what the value should be, what WebCopy is munging it to, and the context around it? That would help me repro the issue and write a unit test.

Unfortunately (as you're probably discovering), the bulk of WebCopy was written long before I got into the habit of writing unit tests and so there's huge chunks of the library which aren't tested effectively. There are core tests for the scanning engine, and I expand these each time there's a bug report or I'm adding new features, but still - it's a complicated code base which really needs refactoring/rewriting for efficiency and extensibility, although it seems that something always breaks due to missing tests.

Thanks for the continued stream of bug reports, sorry for the inconvenience, but it's great to get some valid feedback I can use to improve the software.

Regards;
Richard Moss

forsajt

Right now I am unable to differentiate it due to current bugs (hardly any website downloads correctly). I'm waiting for new version to come.