Making WordPress.org


Ignore:
Timestamp:
07/14/2015 02:02:37 PM (9 years ago)
Author:
ocean90
Message:

Trac Notifications: Avoid PHP notices when a section has no notifications enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php

    r1714 r1740  
    429429
    430430            foreach ( array( 'milestone', 'component', 'focus' ) as $type ) {
    431                 foreach ( $_POST['notifications'][ $type ] as $value => $on ) {
    432                     if ( empty( $notifications[ $type ][ $value ] ) ) {
    433                         $this->trac->insert( '_notifications', compact( 'username', 'type', 'value' ) );
    434                         $notifications[ $type ][ $value ] = true;
     431                if ( ! empty( $_POST['notifications'][ $type ] ) ) {
     432                    foreach ( $_POST['notifications'][ $type ] as $value => $on ) {
     433                        if ( empty( $notifications[ $type ][ $value ] ) ) {
     434                            $this->trac->insert( '_notifications', compact( 'username', 'type', 'value' ) );
     435                            $notifications[ $type ][ $value ] = true;
     436                        }
    435437                    }
    436438                }
Note: See TracChangeset for help on using the changeset viewer.