wpDataTables Lite - Version 2.0.12

Version Description

  • Bug fixes and stability improvements.
Download this release

Release Info

Developer wpDataTables
Plugin Icon 128x128 wpDataTables Lite
Version 2.0.12
Comparing to
See all releases

Code changes from version 2.0.11 to 2.0.12

readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: wordpress table plugin, tables, wpdatatables, tables from excel, tables fr
6
  Requires at least: 4.0
7
  Tested up to: 5.2.2
8
  Requires PHP: 5.4
9
- Stable tag: 2.0.11
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -163,6 +163,9 @@ This can be changed from the “Number format” drop-down menu in the wpDataTab
163
 
164
  == Changelog ==
165
 
 
 
 
166
  = 2.0.11 =
167
  * Bug fixes and stability improvements.
168
  * Compatibility with WordPress 5.2.2 approved.
6
  Requires at least: 4.0
7
  Tested up to: 5.2.2
8
  Requires PHP: 5.4
9
+ Stable tag: 2.0.12
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
163
 
164
  == Changelog ==
165
 
166
+ = 2.0.12 =
167
+ * Bug fixes and stability improvements.
168
+
169
  = 2.0.11 =
170
  * Bug fixes and stability improvements.
171
  * Compatibility with WordPress 5.2.2 approved.
source/class.wdtbrowsechartstable.php CHANGED
@@ -77,6 +77,8 @@ class WDTBrowseChartsTable extends WP_List_Table {
77
  */
78
  function getAllCharts() {
79
  global $wpdb;
 
 
80
  $query = "SELECT id, title, type, engine
81
  FROM {$wpdb->prefix}wpdatacharts ";
82
 
@@ -85,17 +87,16 @@ class WDTBrowseChartsTable extends WP_List_Table {
85
  }
86
 
87
  if (isset($_REQUEST['orderby'])) {
88
- if (in_array(
89
- $_REQUEST['orderby'],
90
- array(
91
- 'id',
92
- 'title',
93
- 'engine',
94
- 'type'
95
- )
96
- )
97
- ) {
98
- $query .= " ORDER BY " . sanitize_text_field($_GET['orderby']);
99
  if ($_REQUEST['order'] == 'desc') {
100
  $query .= " DESC ";
101
  } else {
77
  */
78
  function getAllCharts() {
79
  global $wpdb;
80
+ $predifinedOrderByValue = ['id', 'title', 'engine', 'type'];
81
+ $orderByValue = 'id';
82
  $query = "SELECT id, title, type, engine
83
  FROM {$wpdb->prefix}wpdatacharts ";
84
 
87
  }
88
 
89
  if (isset($_REQUEST['orderby'])) {
90
+ if (in_array($_REQUEST['orderby'], $predifinedOrderByValue)) {
91
+
92
+ $requestOrderByValue = sanitize_text_field($_REQUEST['orderby']);
93
+ foreach ($predifinedOrderByValue as $value) {
94
+ if ($requestOrderByValue === $value){
95
+ $orderByValue = $value;
96
+ }
97
+ }
98
+ $query .= " ORDER BY " . $orderByValue;
99
+
 
100
  if ($_REQUEST['order'] == 'desc') {
101
  $query .= " DESC ";
102
  } else {
source/class.wdtbrowsetable.php CHANGED
@@ -82,6 +82,8 @@ class WDTBrowseTable extends WP_List_Table {
82
  */
83
  function getAllTables() {
84
  global $wpdb;
 
 
85
 
86
  $query = "SELECT id, title, table_type, editable FROM {$wpdb->prefix}wpdatatables ";
87
 
@@ -94,8 +96,15 @@ class WDTBrowseTable extends WP_List_Table {
94
  }
95
 
96
  if (isset($_REQUEST['orderby'])) {
97
- if (in_array($_REQUEST['orderby'], array('id', 'title', 'table_type'))) {
98
- $query .= " ORDER BY " . sanitize_text_field($_REQUEST['orderby']);
 
 
 
 
 
 
 
99
  if ($_REQUEST['order'] == 'desc') {
100
  $query .= " DESC";
101
  } else {
82
  */
83
  function getAllTables() {
84
  global $wpdb;
85
+ $predifinedOrderByValue = ['id', 'title', 'table_type'];
86
+ $orderByValue = 'id';
87
 
88
  $query = "SELECT id, title, table_type, editable FROM {$wpdb->prefix}wpdatatables ";
89
 
96
  }
97
 
98
  if (isset($_REQUEST['orderby'])) {
99
+ if (in_array($_REQUEST['orderby'], $predifinedOrderByValue)) {
100
+
101
+ $requestOrderByValue = sanitize_text_field($_REQUEST['orderby']);
102
+ foreach ($predifinedOrderByValue as $value) {
103
+ if ($requestOrderByValue === $value){
104
+ $orderByValue = $value;
105
+ }
106
+ }
107
+ $query .= " ORDER BY " . $orderByValue;
108
  if ($_REQUEST['order'] == 'desc') {
109
  $query .= " DESC";
110
  } else {
wpdatatables.php CHANGED
@@ -5,7 +5,7 @@
5
  Plugin Name: wpDataTables
6
  Plugin URI: http://tms-plugins.com
7
  Description: Add interactive tables easily from any input source
8
- Version: 2.0.11 Lite
9
  Author: TMS-Plugins
10
  Author URI: http://tms-plugins.com
11
  Text Domain: wpdatatables
5
  Plugin Name: wpDataTables
6
  Plugin URI: http://tms-plugins.com
7
  Description: Add interactive tables easily from any input source
8
+ Version: 2.0.12 Lite
9
  Author: TMS-Plugins
10
  Author URI: http://tms-plugins.com
11
  Text Domain: wpdatatables