Skip to content

Commit

Permalink
Merge pull request #12167 from hannesfostie/grammar-improvement
Browse files Browse the repository at this point in the history
[ci skip] Improves a sentence in guides/security
  • Loading branch information
steveklabnik committed Sep 9, 2013
2 parents ad6e8a2 + 84cea5a commit ff8fac6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guides/source/security.md
Expand Up @@ -481,7 +481,7 @@ A good password is a long alphanumeric combination of mixed cases. As this is qu

INFO: _A common pitfall in Ruby's regular expressions is to match the string's beginning and end by ^ and $, instead of \A and \z._

Ruby uses a slightly different approach than many other languages to match the end and the beginning of a string. That is why even many Ruby and Rails books make this wrong. So how is this a security threat? Say you wanted to loosely validate a URL field and you used a simple regular expression like this:
Ruby uses a slightly different approach than many other languages to match the end and the beginning of a string. That is why even many Ruby and Rails books get this wrong. So how is this a security threat? Say you wanted to loosely validate a URL field and you used a simple regular expression like this:

```ruby
/^https?:\/\/[^\n]+$/i
Expand Down

0 comments on commit ff8fac6

Please sign in to comment.