Commit 222e1334 authored by Camilo Nova's avatar Camilo Nova Committed by Tim Graham
Browse files

Used strict comparison in docs/ref/csrf.txt's JavaScript.

parent 49b4596c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
                }