small js fixes
closes #3106 - hardening url handling, fixes #2725 - backport from upstream
This commit is contained in:
parent
3621576717
commit
4385027443
2 changed files with 6 additions and 2 deletions
|
|
@ -29,6 +29,8 @@
|
|||
text = text.replace(linkRegex, function() {
|
||||
var unicodeUrl = arguments[3];
|
||||
var addr = parse_url(unicodeUrl);
|
||||
if( !addr.host ) addr.host = ""; // must not be 'undefined'
|
||||
|
||||
var asciiUrl = // rebuild the url
|
||||
(!addr.scheme ? '' : addr.scheme +
|
||||
( (addr.scheme.toLowerCase()=="mailto") ? ':' : '://')) +
|
||||
|
|
|
|||
|
|
@ -200,9 +200,11 @@
|
|||
}
|
||||
|
||||
function onInputBoxKeyPress(e) {
|
||||
if(e.keyCode != KEY.BACKSPACE) {
|
||||
var typedValue = String.fromCharCode(e.which || e.keyCode);
|
||||
inputBuffer.push(typedValue);
|
||||
}
|
||||
}
|
||||
|
||||
function onInputBoxKeyDown(e) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue