Skip to content

Commit

Permalink
URL Validation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Kao authored and Jeff Kao committed Aug 22, 2012
1 parent a6c1362 commit f1912df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class window.NewBookmarkView extends Backbone.View

# Main Client-Side URL Validator
validateUrl: (el) ->
if !el.val().match(/^(https?):[/][/]([0-9a-z-])+([\.][0-9a-z]+)+([/][a-z0-9]*)*([?].*)?$/i)
if !el.val().match(/^(https?):[/][/]([0-9a-z-])+([\.][0-9a-z]+)+([/][a-z0-9-]*)*([?].*)?$/i)
$(".control-group.url").addClass("error")
$(".control-group.url .error-messages").text("Looks like a badly formatted URL, buddy! (https://www.example.com)")
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class window.UpdateMyBookmarksView extends Backbone.View

# Main Client-Side URL Validator
validateUrl: (el) ->
if !el.val().match(/^(https?):[/][/]([0-9a-z-])+([\.][0-9a-z]+)+([/][a-z0-9]*)*([?].*)?$/i)
if !el.val().match(/^(https?):[/][/]([0-9a-z-])+([\.][0-9a-z]+)+([/][a-z0-9-]*)*([?].*)?$/i)
$("#update-messages").find(".span9 h4")
.html("<i class='icon-remove-sign' style='vertical-align:baseline;'></i> Looks like a badly formatted URL, buddy! (https://www.example.com)")
$("#update-messages").addClass("red-notification")
Expand Down

0 comments on commit f1912df

Please sign in to comment.