From 5a15da975ff02b2fffdad8376328d2312c578700 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Tue, 17 Mar 2015 23:17:44 -0700 Subject: [PATCH 1/3] fix email validation issue #212 --- controllers/user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/user.js b/controllers/user.js index bb63ceafe4..20fda23b1a 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -94,8 +94,10 @@ exports.getEmailSignup = function(req, res) { */ exports.postEmailSignup = function(req, res, next) { - var errors = req.validationErrors(); + req.assert('email', 'valid email required').isEmail(); + var errors = req.validationErrors(); + if (errors) { req.flash('errors', errors); return res.redirect('/email-signup'); From 752f4125d47a107fc4a496ac934dee69ae523bfb Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sat, 21 Mar 2015 16:36:20 +0900 Subject: [PATCH 2/3] Change decay rate of hot stories to 48 hours --- controllers/story.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/story.js b/controllers/story.js index a48b011289..1bcc4f1037 100644 --- a/controllers/story.js +++ b/controllers/story.js @@ -19,7 +19,7 @@ function hotRank(timeValue, rank) { */ var hotness; var z = Math.log(rank) / Math.log(10); - hotness = z + (timeValue / 45000000); + hotness = z + (timeValue / 1728000000); return hotness; } From ec5b3e4b84a334330f7c06a3c592076a65423f2d Mon Sep 17 00:00:00 2001 From: Nathan Date: Sat, 21 Mar 2015 16:41:29 +0900 Subject: [PATCH 3/3] Change from 1 billion seconds to 172 million. --- controllers/story.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/story.js b/controllers/story.js index 1bcc4f1037..7f38d7cb1a 100644 --- a/controllers/story.js +++ b/controllers/story.js @@ -19,7 +19,7 @@ function hotRank(timeValue, rank) { */ var hotness; var z = Math.log(rank) / Math.log(10); - hotness = z + (timeValue / 1728000000); + hotness = z + (timeValue / 172800000); return hotness; }