Skip to content

Commit

Permalink
Merge pull request #601 from /issues/600/1
Browse files Browse the repository at this point in the history
Fixes #600: remove wyciwyg from URLs (+test).
  • Loading branch information
magsout committed Apr 6, 2015
2 parents c9dfbf4 + 540545d commit bc7ee41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions tests/functional/reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ define([
});
},

'wyciwyg bug workaround': function() {
return this.remote
.setFindTimeout(intern.config.wc.pageLoadTimeout)
.get(require.toUrl(url + '?open=1&url=wyciwyg://0/http://bbs.csdn.net/topics/20282413'))
.findByCssSelector('#url').getProperty('value')
.then(function (value) {
assert.notInclude(value, 'wyciwyg://0/');
})
.end();
},

'validation works': function() {
return this.remote
.setFindTimeout(intern.config.wc.pageLoadTimeout)
Expand Down
12 changes: 6 additions & 6 deletions webcompat/static/js/lib/bugform.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ function BugForm() {
var urlParam = location.search.match(/url=(.+)/);
if (urlParam != null) {
// weird Gecko bug. See https://bugzilla.mozilla.org/show_bug.cgi?id=1098037
urlParam = self.trimWysiwyg(urlParam[1]);
urlParam = self.trimWyciwyg(urlParam[1]);
urlField.val(decodeURIComponent(urlParam));
self.copyURL();
self.makeValid('url');
}
},
trimWysiwyg: function(url) {
//trim wysiwyg://N/ from URL.
var wysiwygRe = /(wysiwyg:\/\/\d+\/)/i;
if (url.search(wysiwygRe) !== 0) {
trimWyciwyg: function(url) {
//trim wyciwyg://N/ from URL.
var wyciwygRe = /(wyciwyg:\/\/\d+\/)/i;
if (url.search(wyciwygRe) !== 0) {
return url;
} else {
return url.replace(wysiwygRe, '');
return url.replace(wyciwygRe, '');
}
},
disableSubmits: function() {
Expand Down

0 comments on commit bc7ee41

Please sign in to comment.