Try to link to http://creativecommons.org/publicdomain/zero/1.0/
Heh, modified the code for this and later realised you assigned yourself. Should I submit it or will you do a patch that does both this and MBS-4810 in one go?
No problem, now we can compare solutions . Mine was like this (don't have access to exact patch right now):
match: new RegExp("^(https?://)?([^/]+\\.)?(artlibre\\.org/licence|creativecommons\\.org/licenses/)", "i"),
match: new RegExp("^(https?://)?([^/]+\\.)?(artlibre\\.org/licence|creativecommons\\.org/(licenses|publicdomain)/)", "i"),
url = url.replace(/^http:\/\/creativecommons\.org\/licenses\/(.+)\/((legalcode|deed)((\.|-)[A-Za-z_]+)?)?/, "http://creativecommons.org/licenses/$1/");
url = url.replace(/^http:\/\/creativecommons\.org\/(licenses|publicdomain\/zero)\/(.+)\/((legalcode|deed)((\.|-)[A-Za-z_]+)?)?/, "http://creativecommons.org/$1/$2/");
What was your approach? As for MBS-4810, it is not that easily solvable as I thought, will comment there.
Mine is exactly the same, except without the zero added there, just (licenses|publicdomain) - since if there are other publicdomain ones now or in the future, I'd expect us to want to support them too.
And yeah, the other one is easy to solve dirtily, but of course
url = url.replace(/^(?:https?:\/\/)?(?:[^\/]+\.)?creativecommons\.org\/(.+)([^\/])$/, "http://creativecommons.org/$1$2/");
means that if the user enters a space or whatever, a new slash will be added, which is horrible
Hmm, but does your code correctly normalize (= strip) "/legalcode" then from the URL? I had to include the "zero" because of that...
url = url.replace(/^http:\/\/creativecommons\.org\/(licenses|publicdomain)\/(.+)\/((legalcode|deed)((\.|-)[A-Za-z_]+)?)?/, "http://creativecommons.org/$1/$2/");
seems to work OK for me in the sandbox, including stripping legalcode
You are right ! You can assign this report to you and submit your patch for review if you like!