Skip to content

Commit bc7ee41

Browse files
committed
Merge pull request #601 from /issues/600/1
Fixes #600: remove wyciwyg from URLs (+test).
2 parents c9dfbf4 + 540545d commit bc7ee41

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

tests/functional/reporting.js

+11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ define([
3030
});
3131
},
3232

33+
'wyciwyg bug workaround': function() {
34+
return this.remote
35+
.setFindTimeout(intern.config.wc.pageLoadTimeout)
36+
.get(require.toUrl(url + '?open=1&url=wyciwyg://0/http://bbs.csdn.net/topics/20282413'))
37+
.findByCssSelector('#url').getProperty('value')
38+
.then(function (value) {
39+
assert.notInclude(value, 'wyciwyg://0/');
40+
})
41+
.end();
42+
},
43+
3344
'validation works': function() {
3445
return this.remote
3546
.setFindTimeout(intern.config.wc.pageLoadTimeout)

webcompat/static/js/lib/bugform.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ function BugForm() {
3838
var urlParam = location.search.match(/url=(.+)/);
3939
if (urlParam != null) {
4040
// weird Gecko bug. See https://bugzilla.mozilla.org/show_bug.cgi?id=1098037
41-
urlParam = self.trimWysiwyg(urlParam[1]);
41+
urlParam = self.trimWyciwyg(urlParam[1]);
4242
urlField.val(decodeURIComponent(urlParam));
4343
self.copyURL();
4444
self.makeValid('url');
4545
}
4646
},
47-
trimWysiwyg: function(url) {
48-
//trim wysiwyg://N/ from URL.
49-
var wysiwygRe = /(wysiwyg:\/\/\d+\/)/i;
50-
if (url.search(wysiwygRe) !== 0) {
47+
trimWyciwyg: function(url) {
48+
//trim wyciwyg://N/ from URL.
49+
var wyciwygRe = /(wyciwyg:\/\/\d+\/)/i;
50+
if (url.search(wyciwygRe) !== 0) {
5151
return url;
5252
} else {
53-
return url.replace(wysiwygRe, '');
53+
return url.replace(wyciwygRe, '');
5454
}
5555
},
5656
disableSubmits: function() {

0 commit comments

Comments
 (0)