Closes issue 480

This commit is contained in:
Jonathan Labreuille
2016-09-21 11:53:27 +02:00
parent 0ba48234de
commit 6091751a4b
14 changed files with 185 additions and 192 deletions

View File

@@ -8,6 +8,7 @@ use \MailPoet\Models\Subscriber;
use \MailPoet\Form\Renderer as FormRenderer;
use \MailPoet\Form\Util;
use \MailPoet\Util\Security;
use \MailPoet\Util\Url;
if(!defined('ABSPATH')) exit;
@@ -148,12 +149,17 @@ class Widget extends \WP_Widget {
'after_title' => (!empty($after_title) ? $after_title : '')
);
// check if the form was successfully submitted via POST (non ajax)
// (POST) non ajax success/error variables
$data['success'] = (
(isset($_GET['mailpoet_success']))
&&
((int)$_GET['mailpoet_success'] === (int)$form['id'])
);
$data['error'] = (
(isset($_GET['mailpoet_error']))
&&
((int)$_GET['mailpoet_error'] === (int)$form['id'])
);
// generate security token
$data['token'] = Security::generateToken();