http://dev.helma.org/bugs/show_bug.cgi?id=690 Summary: String.isUrl() allows invalid URLs
Product: Helma
Version: CVS trunk
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P5
Component: helmaLib, helmaTools
AssignedTo:
helma-dev@...
ReportedBy:
philipp.naderer@...
http://<ishoudfail>asdf.com will be a valid URL, but Helma will just return
"
http://asdf.com". After creating the URL in the try-block, it should not
return the java.net.URL, but rather a boolean true or false. So the last
"return true" is unreachable code.
Also String.URLPATTERN is not very fine grained.
String.prototype.isUrl = function() {
if (String.URLPATTERN.test(this))
return true;
try {
return new java.net.URL(this);
} catch (err) {
return false;
}
return true;
};
--
Configure bugmail:
http://dev.helma.org/bugs/userprefs.cgi?tab=email------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev