HolyDiablo / phpvirtualbox

Automatically exported from code.google.com/p/phpvirtualbox
Other
0 stars 0 forks source link

Port forward : cannot type "." in ip address #653

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Go to machine settings, Network, Advanced, "port forwarding".
There are 6 fields:
name, protocol, host ip, host post, guest ip, guest port.
Unfortunately, the IP address cannot be filled because the dot is not 
authorized.

phpVirtualBox/Virtualbox 4.2.4, PHP 5.3.3

Original issue reported on code.google.com by g...@atomas.com on 17 Dec 2012 at 8:20

GoogleCodeExporter commented 8 years ago
js/utils.js:

Change:
function vboxValidateIP(k) {
    return (vboxValidateNum(k) || k == 190);
}

to:
function vboxValidateIP(k) {
    return (vboxValidateNum(k) || k == 190 || k == 110 || k == 59);
}

110 is the scancode of "." on keypad, and 59 is the scancode of for "." on a 
azerty keyboard (windows 7).

By the way, it is a very bad idea to use scancode for checking anything but the 
actual position of a key, see: http://unixpapa.com/js/key.html

Original comment by g...@atomas.com on 17 Dec 2012 at 11:09

GoogleCodeExporter commented 8 years ago
// add opera keypad "." scancode (source:http://unixpapa.com/js/key.html)
function vboxValidateIP(k) {
    return (vboxValidateNum(k) || k == 190 || k == 110 || k == 59 || k==78);
}

Original comment by g...@atomas.com on 18 Dec 2012 at 5:53

GoogleCodeExporter commented 8 years ago
Thanks for the fix. This will be added in the next version.

Original comment by imooreya...@gmail.com on 11 Jul 2013 at 4:04