Email Before Download - Version 5.1.8

Version Description

Download this release

Release Info

Developer mandsconsulting
Plugin Icon 128x128 Email Before Download
Version 5.1.8
Comparing to
See all releases

Code changes from version 5.1.7 to 5.1.8

email-before-download.php CHANGED
@@ -11,7 +11,7 @@
11
  * @wordpress-plugin
12
  * Plugin Name: Email Before Download
13
  * Plugin URI: mandsconsulting.com
14
- * Version: 5.1.7
15
  * Author: M&S Consulting
16
  * Author URI: mandsconsulting.com
17
  * License: GPL-2.0+
@@ -24,7 +24,7 @@ if ( ! defined( 'WPINC' ) ) {
24
  die;
25
  }
26
 
27
- define( 'PLUGIN_NAME_VERSION', '5.1.7' );
28
 
29
  function activate_email_before_download() {
30
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-email-before-download-activator.php';
11
  * @wordpress-plugin
12
  * Plugin Name: Email Before Download
13
  * Plugin URI: mandsconsulting.com
14
+ * Version: 5.1.8
15
  * Author: M&S Consulting
16
  * Author URI: mandsconsulting.com
17
  * License: GPL-2.0+
24
  die;
25
  }
26
 
27
+ define( 'PLUGIN_NAME_VERSION', '5.1.8' );
28
 
29
  function activate_email_before_download() {
30
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-email-before-download-activator.php';
includes/class-email-before-download-form.php CHANGED
@@ -32,7 +32,7 @@ class Email_Before_Download_Form
32
  $form = new DOMDocument;
33
  libxml_use_internal_errors(true);
34
  $form->formatOutput = true;
35
- $form->loadHTML(mb_convert_encoding($raw, 'HTML-ENTITIES', 'UTF-8'));
36
  $parent = $form->getElementsByTagName('form')->item(0);
37
  $formID = $parent->getAttribute('action');
38
  $tmp = explode('#', $formID);
32
  $form = new DOMDocument;
33
  libxml_use_internal_errors(true);
34
  $form->formatOutput = true;
35
+ $form->loadHTML(mb_convert_encoding($raw, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
36
  $parent = $form->getElementsByTagName('form')->item(0);
37
  $formID = $parent->getAttribute('action');
38
  $tmp = explode('#', $formID);
public/class-email-before-download-public.php CHANGED
@@ -55,28 +55,39 @@ class Email_Before_Download_Public
55
  return $content;
56
  }
57
 
58
- public function ebd_ajax(){
59
- check_ajax_referer( 'ebd', 'security');
 
60
  $permalink = get_option('permalink_structure');
61
- if($permalink != ""){
62
  $spacer = "?uid=";
63
- }else{
64
  $spacer = "&uid=";
65
 
66
  }
67
  $postData = sanitize_post($_POST);
68
  $data = array();
69
  $htmlBefore = get_option('email_before_download_html_before');
70
- $htmlAfter = get_option('email_before_download_html_after');
71
  $linkCSS = get_option('email_before_download_link_css');
72
  $db = new Email_Before_Download_DB();
73
  $links = array();
74
  $linksHTML = "";
75
- foreach ($postData['downloads'] as $download){
 
 
 
 
 
 
 
 
 
 
76
  $tmp = explode('|', $download);
77
  $links[$tmp[0]]['title'] = $tmp[1];
78
  }
79
- foreach ($postData['settings'] as $item){
80
  $tmp = explode('|',$item);
81
  $settings[$tmp[0]] = $tmp[1];
82
  }
55
  return $content;
56
  }
57
 
58
+ public function ebd_ajax()
59
+ {
60
+ check_ajax_referer('ebd', 'security');
61
  $permalink = get_option('permalink_structure');
62
+ if ($permalink != "") {
63
  $spacer = "?uid=";
64
+ } else {
65
  $spacer = "&uid=";
66
 
67
  }
68
  $postData = sanitize_post($_POST);
69
  $data = array();
70
  $htmlBefore = get_option('email_before_download_html_before');
71
+ $htmlAfter = get_option('email_before_download_html_after');
72
  $linkCSS = get_option('email_before_download_link_css');
73
  $db = new Email_Before_Download_DB();
74
  $links = array();
75
  $linksHTML = "";
76
+ if(!is_array($postData['downloads'])){
77
+ $downloads = array($postData['downloads']);
78
+ }else {
79
+ $downloads = $postData['downloads'];
80
+ }
81
+ if(!is_array($postData['settings'])){
82
+ $postSettings = array($postData['settings']);
83
+ }else {
84
+ $postSettings = $postData['settings'];
85
+ }
86
+ foreach($downloads as $download){
87
  $tmp = explode('|', $download);
88
  $links[$tmp[0]]['title'] = $tmp[1];
89
  }
90
+ foreach ($postSettings as $item){
91
  $tmp = explode('|',$item);
92
  $settings[$tmp[0]] = $tmp[1];
93
  }
readme.txt CHANGED
@@ -106,6 +106,10 @@ This is the list of all short code attributes that can be used. Some of them o
106
 
107
 
108
  == Changelog ==
 
 
 
 
109
  =5.1.7=
110
  * Fixed issue with some malformed HTML being created by DOMDocument()
111
  =5.1.6=
106
 
107
 
108
  == Changelog ==
109
+ =5.1.8=
110
+ * Fixed issue with some browsers not showing UTC-8 characters properly
111
+ * cleaned up some code to remove PHP warnings
112
+
113
  =5.1.7=
114
  * Fixed issue with some malformed HTML being created by DOMDocument()
115
  =5.1.6=