Closed
Bug 268619
Opened 20 years ago
Closed 9 years ago
Port number validity checking function
Categories
(Core :: Networking, enhancement)
Core
Networking
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: benc, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
|
1.98 KB,
text/html
|
Details |
This function is for checking the validity of a port number.
Here's the initial code:
function validatePort(portnumber) {
if ((/^\d{1,5}$/).test(portnumber) ) {
if ( parseInt (portnumber, 10) < 65536) {
return (true)
}
return (false)
}
return (false)
I've scanned the results of searching for "port" in bugzilla, and found several
places this would be useful:
Proxy prefs, image blocking, cookies, LDAP, mailnews, chatzilla. There might be
additional locations. (CCK and Installer also, assuming they use javascript).here is a test harness for the function. You can type in any values you think should pass/fail, and see what the function returns.
opps, the top field/button was not working...
Attachment #165306 -
Attachment is obsolete: true
Comment 3•20 years ago
|
||
This may sound silly, but "why do we care?"
mostly UI, but also having a consistent, correct function can help w/ a lot of internal port number handling.
James: see bug 189253.
Updated•18 years ago
|
Assignee: darin → nobody
QA Contact: benc → networking
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•