Skip to content

Commit

Permalink
[1.9.x] Used strict comparison in docs/ref/csrf.txt's JavaScript.
Browse files Browse the repository at this point in the history
Backport of 222e133 from master
  • Loading branch information
camilonova authored and timgraham committed Jun 28, 2016
1 parent 54c0dea commit e1d83c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/ref/csrf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ Acquiring the token is straightforward:
// using jQuery
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
if (document.cookie && document.cookie !== '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
if (cookie.substring(0, name.length + 1) === (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
Expand Down

0 comments on commit e1d83c2

Please sign in to comment.