Gravity PDF - Version 3.5.3

Version Description

  • Bug - Mergetags braces ({}) were being encoded before conversion
  • Bug - Fixed issue with empty string being passed to array filter
  • Housekeeping - Enabled mergetag usage in the pdf_password and pdf_master_password configuration options
  • Housekeeping - Correctly call $wpdb->prepare so the variables in are in the second argument
Download this release

Release Info

Developer Blue Liquid Designs
Plugin Icon 128x128 Gravity PDF
Version 3.5.3
Comparing to
See all releases

Code changes from version 3.5.2 to 3.5.3

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.gravityformspdfextended.com
4
  Tags: gravity, forms, pdf, automation, attachment
5
  Requires at least: 3.5
6
  Tested up to: 3.9
7
- Stable tag: 3.5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,11 +75,18 @@ All FAQs can be [viewed on the Gravity Forms PDF Extended website](http://gravit
75
 
76
  == Screenshots ==
77
 
78
- 1. View PDF from the Gravity Forms entries list.
79
- 2. View or download the PDF from a Gravity Forms entry.
 
80
 
81
  == Changelog ==
82
 
 
 
 
 
 
 
83
  = 3.5.2 =
84
  * Bug - Initialisation folder .htaccess file was preventing template.css from being loaded by the default templates.
85
 
4
  Tags: gravity, forms, pdf, automation, attachment
5
  Requires at least: 3.5
6
  Tested up to: 3.9
7
+ Stable tag: 3.5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
 
76
  == Screenshots ==
77
 
78
+ 1. The View PDF button is avaliable for each Gravity Form entry
79
+ 2. Multiple PDFs can be assigned to a form and is also avaliable on the detailed entry view.
80
+ 3. The configuration.php file allows you to easily assign PDFs to Gravity Forms
81
 
82
  == Changelog ==
83
 
84
+ = 3.5.3 =
85
+ * Bug - Mergetags braces ({}) were being encoded before conversion
86
+ * Bug - Fixed issue with empty string being passed to array filter
87
+ * Housekeeping - Enabled mergetag usage in the pdf_password and pdf_master_password configuration options
88
+ * Housekeeping - Correctly call $wpdb->prepare so the variables in are in the second argument
89
+
90
  = 3.5.2 =
91
  * Bug - Initialisation folder .htaccess file was preventing template.css from being loaded by the default templates.
92
 
helper/pdf-common.php CHANGED
@@ -107,12 +107,19 @@ class PDF_Common
107
  */
108
  public static function do_mergetags($string, $form_id, $lead_id)
109
  {
 
110
  $form = RGFormsModel::get_form_meta($form_id);
111
  $lead = RGFormsModel::get_lead($lead_id);
112
-
 
 
 
 
 
 
113
  /* strip {all_fields} merge tag from $string */
114
  $string = str_replace('{all_fields}', '', $string);
115
-
116
  return trim(GFCommon::replace_variables($string, $form, $lead, false, false, false));
117
  }
118
 
@@ -186,6 +193,6 @@ class PDF_Common
186
  return $_GET[$name];
187
 
188
  return '';
189
- }
190
  }
191
 
107
  */
108
  public static function do_mergetags($string, $form_id, $lead_id)
109
  {
110
+
111
  $form = RGFormsModel::get_form_meta($form_id);
112
  $lead = RGFormsModel::get_lead($lead_id);
113
+
114
+ /*
115
+ * Unconvert { and } symbols from HTML entities
116
+ */
117
+ $string = str_replace('{', '{', $string);
118
+ $string = str_replace('}', '}', $string);
119
+
120
  /* strip {all_fields} merge tag from $string */
121
  $string = str_replace('{all_fields}', '', $string);
122
+
123
  return trim(GFCommon::replace_variables($string, $form, $lead, false, false, false));
124
  }
125
 
193
  return $_GET[$name];
194
 
195
  return '';
196
+ }
197
  }
198
 
helper/pdf-entry-detail.php CHANGED
@@ -1004,12 +1004,11 @@ if(!class_exists('GFPDFEntryDetail'))
1004
  /*
1005
  * Check if there are any values in the list
1006
  */
1007
- if(sizeof($list) == 0)
1008
  {
1009
  return $list;
1010
  }
1011
 
1012
-
1013
  /*
1014
  * Check if it's a multi column list
1015
  */
1004
  /*
1005
  * Check if there are any values in the list
1006
  */
1007
+ if(!is_array($list) || sizeof($list) == 0)
1008
  {
1009
  return $list;
1010
  }
1011
 
 
1012
  /*
1013
  * Check if it's a multi column list
1014
  */
model/pdf.php CHANGED
@@ -251,7 +251,7 @@ class GFPDF_Core_Model
251
  /*
252
  * Check the lead is in the database and the IP address matches (little security booster)
253
  */
254
- $form_entries = $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM `".$wpdb->prefix."rg_lead` WHERE form_id = ".$form_id." AND status = 'active' AND id = ".$lead_id." AND ip = '".$ip."'", array() ) );
255
 
256
  if($form_entries == 0 && $gfpdf->configuration[$index]['access'] !== 'all')
257
  {
@@ -272,7 +272,7 @@ class GFPDF_Core_Model
272
  * User doesn't have the correct access privilages
273
  * Let's check if they are assigned to the form
274
  */
275
- $user_logged_entries = $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM `".$wpdb->prefix."rg_lead` WHERE form_id = ".$form_id." AND status = 'active' AND id = ".$lead_id." AND created_by = '". get_current_user_id() ."'", array() ) );
276
 
277
  /*
278
  * Failed again.
@@ -281,7 +281,7 @@ class GFPDF_Core_Model
281
  */
282
  if($user_logged_entries == 0)
283
  {
284
- $form_entries = $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM `".$wpdb->prefix."rg_lead` WHERE form_id = ".$form_id." AND status = 'active' AND id = ".$lead_id." AND ip = '".$ip."'", array() ) );
285
 
286
  if($form_entries == 0)
287
  {
@@ -588,13 +588,14 @@ class GFPDF_Core_Model
588
  */
589
  $privileges = (isset($config['pdf_privileges'])) ? $gfpdf->validate_privileges($config['pdf_privileges']) : $gfpdf->validate_privileges('');
590
 
591
- $pdf_password = (isset($config['pdf_password'])) ? $config['pdf_password'] : '';
592
- $master_password = (isset($config['pdf_master_password'])) ? $config['pdf_master_password'] : '';
593
  $rtl = (isset($config['rtl'])) ? $config['rtl'] : false;
594
 
595
 
596
  $form = RGFormsModel::get_form_meta($form_id);
597
  $lead = RGFormsModel::get_lead($lead_id);
 
598
  /*
599
  * Run the options through filters
600
  */
251
  /*
252
  * Check the lead is in the database and the IP address matches (little security booster)
253
  */
254
+ $form_entries = $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM `".$wpdb->prefix."rg_lead` WHERE form_id = %d AND status = 'active' AND id = %d AND ip = %s", array($form_id, $lead_id, $ip) ) );
255
 
256
  if($form_entries == 0 && $gfpdf->configuration[$index]['access'] !== 'all')
257
  {
272
  * User doesn't have the correct access privilages
273
  * Let's check if they are assigned to the form
274
  */
275
+ $user_logged_entries = $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM `".$wpdb->prefix."rg_lead` WHERE form_id = %d AND status = 'active' AND id = %d AND created_by = %d", array($form_id, $lead_id, get_current_user_id()) ) );
276
 
277
  /*
278
  * Failed again.
281
  */
282
  if($user_logged_entries == 0)
283
  {
284
+ $form_entries = $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM `".$wpdb->prefix."rg_lead` WHERE form_id = %d AND status = 'active' AND id = %d AND ip = %s", array($form_id, $lead_id, $ip) ) );
285
 
286
  if($form_entries == 0)
287
  {
588
  */
589
  $privileges = (isset($config['pdf_privileges'])) ? $gfpdf->validate_privileges($config['pdf_privileges']) : $gfpdf->validate_privileges('');
590
 
591
+ $pdf_password = (isset($config['pdf_password'])) ? PDF_Common::do_mergetags($config['pdf_password'], $form_id, $lead_id) : '';
592
+ $master_password = (isset($config['pdf_master_password'])) ? PDF_Common::do_mergetags($config['pdf_master_password'], $form_id, $lead_id) : '';
593
  $rtl = (isset($config['rtl'])) ? $config['rtl'] : false;
594
 
595
 
596
  $form = RGFormsModel::get_form_meta($form_id);
597
  $lead = RGFormsModel::get_lead($lead_id);
598
+
599
  /*
600
  * Run the options through filters
601
  */
pdf.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Gravity Forms PDF Extended
5
  Plugin URI: http://www.gravityformspdfextended.com
6
  Description: Gravity Forms PDF Extended allows you to save/view/download a PDF from the front- and back-end, and automate PDF creation on form submission. Our Business Plus package also allows you to overlay field onto an existing PDF.
7
- Version: 3.5.2
8
  Author: Blue Liquid Designs
9
  Author URI: http://www.blueliquiddesigns.com.au
10
 
@@ -33,7 +33,7 @@ GNU General Public License for more details.
33
  /*
34
  * Define our constants
35
  */
36
- define('PDF_EXTENDED_VERSION', '3.5.2');
37
  define('GF_PDF_EXTENDED_SUPPORTED_VERSION', '1.7');
38
  define('GF_PDF_EXTENDED_WP_SUPPORTED_VERSION', '3.5');
39
  define('GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION', '5');
@@ -196,7 +196,6 @@ class GFPDF_Core extends PDFGenerator
196
  add_filter('gfpdfe_pdf_template', array('PDF_Common', 'do_mergetags'), 10, 3); /* convert mergetags in PDF template automatically */
197
  add_filter('gfpdfe_pdf_template', 'do_shortcode', 10, 1); /* convert shortcodes in PDF template automatically */
198
 
199
-
200
  /* Check if on the entries page and output javascript */
201
  if(is_admin() && rgget('page') == 'gf_entries')
202
  {
4
  Plugin Name: Gravity Forms PDF Extended
5
  Plugin URI: http://www.gravityformspdfextended.com
6
  Description: Gravity Forms PDF Extended allows you to save/view/download a PDF from the front- and back-end, and automate PDF creation on form submission. Our Business Plus package also allows you to overlay field onto an existing PDF.
7
+ Version: 3.5.3
8
  Author: Blue Liquid Designs
9
  Author URI: http://www.blueliquiddesigns.com.au
10
 
33
  /*
34
  * Define our constants
35
  */
36
+ define('PDF_EXTENDED_VERSION', '3.5.3');
37
  define('GF_PDF_EXTENDED_SUPPORTED_VERSION', '1.7');
38
  define('GF_PDF_EXTENDED_WP_SUPPORTED_VERSION', '3.5');
39
  define('GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION', '5');
196
  add_filter('gfpdfe_pdf_template', array('PDF_Common', 'do_mergetags'), 10, 3); /* convert mergetags in PDF template automatically */
197
  add_filter('gfpdfe_pdf_template', 'do_shortcode', 10, 1); /* convert shortcodes in PDF template automatically */
198
 
 
199
  /* Check if on the entries page and output javascript */
200
  if(is_admin() && rgget('page') == 'gf_entries')
201
  {
view/templates/settings/changelog.php CHANGED
@@ -22,6 +22,15 @@
22
 
23
  <h3><?php echo PDF_EXTENDED_VERSION; ?></h3>
24
 
 
 
 
 
 
 
 
 
 
25
  <ul>
26
  <li>Bug - Initialisation folder .htaccess file was preventing template.css from being loaded by the default templates.</li>
27
  </ul>
22
 
23
  <h3><?php echo PDF_EXTENDED_VERSION; ?></h3>
24
 
25
+
26
+ <ul>
27
+ <li>Bug - Mergetags braces ({}) were being encoded before conversion</li>
28
+ <li>Bug - Fixed issue with empty string being passed to array filter</li>
29
+ <li>Housekeeping - Enabled mergetag usage in the pdf_password and pdf_master_password configuration options</li>
30
+ <li>Housekeeping - Correctly call $wpdb->prepare so the variables in are in the second argument</li>
31
+ </ul>
32
+
33
+ <h3>3.5.2</h3>
34
  <ul>
35
  <li>Bug - Initialisation folder .htaccess file was preventing template.css from being loaded by the default templates.</li>
36
  </ul>