PluginProbe
Chartify – WordPress Chart Plugin / 3.5.4
Chartify – WordPress Chart Plugin v3.5.4
3.8.0 3.7.9 3.7.8 3.7.7 3.7.6 3.7.5 trunk 1.0.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 All 83 releases
← All changes | includes/class-chart-builder-actions.php +9 -9 3.1.53.5.4 View file →
@@ -821,18 +821,18 @@
821 821
822 822 public function get_charts($ordering = ''){
823 823 global $wpdb;
824 824 $charts_table = esc_sql( $wpdb->prefix . CHART_BUILDER_DB_PREFIX ) . "charts";
825 -
826 - $sql = "SELECT id,title
827 - FROM {$charts_table} WHERE `status` = 'published' OR `status` = 'draft'";
828 -
829 -
830 - if($ordering != ''){
831 - $sql .= ' ORDER BY id '.$ordering;
825 +
826 + $sql = "SELECT id, title FROM {$charts_table} WHERE `status` IN (%s, %s)";
827 + $params = array('published', 'draft');
828 +
829 + if ( $ordering != '' ) {
830 + $sql .= " ORDER BY id {$ordering}";
832 831 }
833 -
834 - $charts = $wpdb->get_results( $sql , "ARRAY_A" );
832 + // phpcs:ignore
833 + $charts = $wpdb->get_results( $wpdb->prepare( $sql, ...$params ), 'ARRAY_A' );
834 +
835 835
836 836 return $charts;
837 837 }
838 838 }