small js fixes

closes #3106 - hardening url handling,
fixes #2725 - backport from upstream
This commit is contained in:
Florian Staudacher 2012-04-18 19:58:05 +02:00
parent 3621576717
commit 4385027443
2 changed files with 6 additions and 2 deletions

View file

@ -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") ? ':' : '://')) +

View file

@ -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) {