Validating a valid URL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shabam

    Validating a valid URL

    Is there a function that validates if a URL is valid or not? Basically I'm
    trying to filter out bogus input, and things like cross site scripting
    attacks.

    Example:
    <img src="javascript :alert(document .cookie)">

    Doing it by regex seems way too complicated and there could be holes in the
    logic if something is missed.


  • Cor Ligthert

    #2
    Re: Validating a valid URL

    Shabam,

    Your question is not new in dotnet Newsgroups, I did a search on Google
    here are some, sorry using regex.



    When that does not fit, I would ask it as well crossposted as you already
    did in the newsgroups.
    Microsoft.publi c.dotnet.langua ges.vb (or csharp) according what you use
    and
    Microsoft.publi c.dotnet.framew ork.aspnet

    I hope this helps?

    Cor

    "Shabam" <blislecp@hotma il.com> > Is there a function that validates if a
    URL is valid or not? Basically I'm[color=blue]
    > trying to filter out bogus input, and things like cross site scripting
    > attacks.
    >
    > Example:
    > <img src="javascript :alert(document .cookie)">
    >
    > Doing it by regex seems way too complicated and there could be holes in
    > the
    > logic if something is missed.
    >
    >[/color]


    Comment

    Working...