From d9e53698d50c534ee33512c55ac3531481c32b72 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 16 Mar 2015 00:11:12 -0400 Subject: Epirts.setPublishableKey(): Improve validation --- diff --git a/epirts.js b/epirts.js index 1e03ef4..9a6334d 100644 --- a/epirts.js +++ b/epirts.js @@ -132,7 +132,7 @@ var Stripe = Epirts = (function() { if (typeof key !== 'string') { throw new Error('Invalid publishable key'); } - if (!key.match(/^pk_[A-Za-z0-9_]+/)) { + if (!key.match(/^pk_(test|live)_[A-Za-z0-9]+/)) { throw new Error('Invalid publishable key'); } _key = key; -- cgit v0.9.1