Ultimate FAQ - Version 1.8.25

Version Description

  • Adds in extra verifications for the import and export forms
Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Ultimate FAQ
Version 1.8.25
Comparing to
See all releases

Code changes from version 1.8.24 to 1.8.25

Functions/EWD_UFAQ_Export.php CHANGED
@@ -1,5 +1,10 @@
1
  <?php
2
  function EWD_UFAQ_Export_To_PDF() {
 
 
 
 
 
3
  require_once(EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php');
4
  global $Category; /*Undefined Category variable at line 5 and 7*/
5
  // if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {$category_array = array( 'taxonomy' => 'ufaq-category',
@@ -73,6 +78,11 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
73
  use PhpOffice\PhpSpreadsheet\Writer\Xls;
74
  use PhpOffice\PhpSpreadsheet\Writer\Csv;
75
  function EWD_UFAQ_Export_To_Excel() {
 
 
 
 
 
76
  $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
77
  if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
78
 
1
  <?php
2
  function EWD_UFAQ_Export_To_PDF() {
3
+
4
+ // make sure that the request is coming from the admin form
5
+ if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
6
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
7
+
8
  require_once(EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php');
9
  global $Category; /*Undefined Category variable at line 5 and 7*/
10
  // if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {$category_array = array( 'taxonomy' => 'ufaq-category',
78
  use PhpOffice\PhpSpreadsheet\Writer\Xls;
79
  use PhpOffice\PhpSpreadsheet\Writer\Csv;
80
  function EWD_UFAQ_Export_To_Excel() {
81
+
82
+ // make sure that the request is coming from the admin form
83
+ if ( ! isset( $_POST['EWD_UFAQ_Export_Nonce'] ) ) { return; }
84
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_Nonce'], 'EWD_UFAQ_Export' ) ) { return; }
85
+
86
  $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
87
  if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
88
 
Functions/EWD_UFAQ_Export_To_PDF.php CHANGED
@@ -1,5 +1,9 @@
1
  <?php
2
  function EWD_UFAQ_Export_To_PDF() {
 
 
 
 
3
  require_once(EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php');
4
 
5
  if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {
1
  <?php
2
  function EWD_UFAQ_Export_To_PDF() {
3
+ // make sure that the request is coming from the admin form
4
+ if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
5
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
6
+
7
  require_once(EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php');
8
 
9
  if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {
Functions/EWD_UFAQ_Import.php CHANGED
@@ -42,6 +42,13 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
42
  function Add_EWD_UFAQs_From_Spreadsheet($Excel_File_Name){
43
  global $wpdb;
44
 
 
 
 
 
 
 
 
45
  $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
46
  if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
47
 
42
  function Add_EWD_UFAQs_From_Spreadsheet($Excel_File_Name){
43
  global $wpdb;
44
 
45
+ // check that the current user has the correct privileges to create posts
46
+ if ( ! current_user_can( 'edit_posts' ) ) { return; }
47
+
48
+ // make sure that the request is coming from the admin form
49
+ if ( ! isset( $_POST['EWD_UFAQ_Import_Nonce'] ) ) { return; }
50
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Import_Nonce'], 'EWD_UFAQ_Import' ) ) { return; }
51
+
52
  $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
53
  if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
54
 
Main.php CHANGED
@@ -7,7 +7,7 @@ Author: Etoile Web Design
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
- Version: 1.8.24
11
  */
12
 
13
  global $ewd_ufaq_message;
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
+ Version: 1.8.25
11
  */
12
 
13
  global $ewd_ufaq_message;
html/ExportPage.php CHANGED
@@ -12,6 +12,9 @@
12
  <?php } ?>
13
 
14
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToPDF">
 
 
 
15
  <table class="form-table">
16
  </table>
17
 
@@ -19,6 +22,7 @@
19
  <p class="submit"><input type="submit" name="Export_Submit" id="submit" class="button button-primary" value="Export to PDF" <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /></p></form>
20
 
21
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToSpreadsheet">
 
22
  <table class="form-table">
23
  </table>
24
 
12
  <?php } ?>
13
 
14
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToPDF">
15
+
16
+ <?php wp_nonce_field( 'EWD_UFAQ_Export_PDF', 'EWD_UFAQ_Export_PDF_Nonce' ); ?>
17
+
18
  <table class="form-table">
19
  </table>
20
 
22
  <p class="submit"><input type="submit" name="Export_Submit" id="submit" class="button button-primary" value="Export to PDF" <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /></p></form>
23
 
24
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToSpreadsheet">
25
+ <?php wp_nonce_field( 'EWD_UFAQ_Export', 'EWD_UFAQ_Export_Nonce' ); ?>
26
  <table class="form-table">
27
  </table>
28
 
html/ImportPage.php CHANGED
@@ -13,6 +13,9 @@
13
 
14
  <h4>Import FAQs from a spreadsheet</h4>
15
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=ImportPosts&Action=EWD_UFAQ_ImportFaqsFromSpreadsheet" enctype="multipart/form-data">
 
 
 
16
  <div class="form-field form-required">
17
  <label for="FAQs_Spreadsheet"><?php _e("Spreadsheet Containing FAQs", 'ultimate-faqs') ?></label><br />
18
  <input name="FAQs_Spreadsheet" id="FAQs_Spreadsheet" type="file" value=""/>
13
 
14
  <h4>Import FAQs from a spreadsheet</h4>
15
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=ImportPosts&Action=EWD_UFAQ_ImportFaqsFromSpreadsheet" enctype="multipart/form-data">
16
+
17
+ <?php wp_nonce_field( 'EWD_UFAQ_Import', 'EWD_UFAQ_Import_Nonce' ); ?>
18
+
19
  <div class="form-field form-required">
20
  <label for="FAQs_Spreadsheet"><?php _e("Spreadsheet Containing FAQs", 'ultimate-faqs') ?></label><br />
21
  <input name="FAQs_Spreadsheet" id="FAQs_Spreadsheet" type="file" value=""/>
readme.txt CHANGED
@@ -280,6 +280,9 @@ Video 3 - FAQs Ordering
280
 
281
 
282
  == Changelog ==
 
 
 
283
  = 1.8.24 =
284
  - Correcting notices
285
 
280
 
281
 
282
  == Changelog ==
283
+ = 1.8.25 =
284
+ - Adds in extra verifications for the import and export forms
285
+
286
  = 1.8.24 =
287
  - Correcting notices
288