Changeset 8905
- Timestamp:
- 06/03/2019 03:21:30 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-components.php
r7664 r8905 400 400 401 401 $followers = $this->api->get_component_followers( $post->post_title ); 402 $followers = "'" . implode( "', '", esc_sql( $followers ) ) . "'"; 403 $followers = $wpdb->get_results( "SELECT user_login, user_nicename, user_email FROM $wpdb->users WHERE user_login IN ($followers)" ); 402 if ( $followers ) { 403 $followers = "'" . implode( "', '", esc_sql( $followers ) ) . "'"; 404 $followers = $wpdb->get_results( "SELECT user_login, user_nicename, user_email FROM $wpdb->users WHERE user_login IN ($followers)" ); 405 } 404 406 if ( $followers ) { 405 407 echo 'Contributors following this component:'; … … 484 486 485 487 $history = $this->api->get_component_history( $component, self::last_x_days ); 488 if ( ! $history ) { 489 $history = array( 'change' => 0 ); // Incorrect, but allows full page render. 490 } 491 486 492 $direction = ''; 487 493 if ( $history['change'] > 0 ) { … … 555 561 556 562 $tickets_by_type = $this->api->get_ticket_counts_for_component( $component ); 563 if ( ! $tickets_by_type ) { 564 $tickets_by_type = array( 'defect (bug)' => 0 ); // Incorrect, but allows page render 565 } 557 566 558 567 $count = array_sum( $tickets_by_type ); … … 638 647 if ( in_array( 'component', $topics ) ) { 639 648 $components = $this->api->get_components(); 640 foreach ( $components as $component ) { 641 echo '<option value="component/' . esc_attr( rawurlencode( $component ) ) . '">' . esc_html( $component ) . "</option>"; 649 if ( $components ) { 650 foreach ( $components as $component ) { 651 echo '<option value="component/' . esc_attr( rawurlencode( $component ) ) . '">' . esc_html( $component ) . "</option>"; 652 } 642 653 } 643 654 } … … 652 663 } 653 664 665 $component = $post->post_title; 666 $history = $this->api->get_component_history( $component ); 667 668 if ( ! $history ) { 669 return; 670 } 671 654 672 static $once = true; 655 673 if ( $once ) { … … 657 675 echo '<thead><tr><td>Component</td><td>Tickets</td><td>7 Days</td><td>0 Replies</td><td>Maintainers</td></tr></thead>'; 658 676 } 659 660 $component = $post->post_title;661 $history = $this->api->get_component_history( $component );662 677 663 678 $arrow = '';
Note: See TracChangeset
for help on using the changeset viewer.