PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 3.5.4
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v3.5.4
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
← All changes | includes/models/class-wpsc-customer.php +4 -1 3.3.8 → 3.5.4 View file →
@@ -805,9 +805,12 @@
805 805 */
806 806 public function update_ticket_count() {
807 807
808 808 global $wpdb;
809 - $count = $wpdb->get_var( "SELECT count(id) from {$wpdb->prefix}psmsc_tickets WHERE is_active=1 AND customer=" . $this->id );
809 + if ( ! is_numeric( $this->id ) || (int) $this->id <= 0 ) {
810 + return;
811 + }
812 + $count = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$wpdb->prefix}psmsc_tickets WHERE is_active=1 AND customer=%d", $this->id ) );
810 813 $this->ticket_count = $count;
811 814 $this->save();
812 815 }
813 816