Permalink
Browse files

made question and points factor into checksum so the question or poin…

…ts cannot be changed and have the same answer used and it work
  • Loading branch information...
1 parent cfa713b commit f60f26c6eab3ff0ce097c6e911938dc36e9b649a Joe Levy committed Mar 2, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 js/makeUrl.js
View
13 js/makeUrl.js
@@ -18,10 +18,15 @@ $(function() {
alert('Please enter a numeric point value');
return false;
}
-
- var url = window.location.host + "/hunt/?q="+encodeURIComponent(question)+"&answer="+encodeURIComponent(MD5(answer))+"&points="+encodeURIComponent(points);
- $("#url").html("<a href='"+url+"'>"+url+"</a>");
+
+ var hash = makeHash(question,answer,points);
+ var url = window.location.host + "/hunt/?q="+encodeURIComponent(question)+"&checksum="+encodeURIComponent(hash)+"&points="+encodeURIComponent(points);
+ $("#url").html("<a href='http://"+url+"'>"+url+"</a>");
return false;
});
-});
+});
+
+function makeHash(question,answer,points) {
+ return MD5(question+answer+points);
+}

0 comments on commit f60f26c

Please sign in to comment.