[wp-trac] [WordPress Trac] #25030: Overlapping upload paths with multiple networks

WordPress Trac noreply at wordpress.org
Fri Aug 23 23:29:57 UTC 2013


#25030: Overlapping upload paths with multiple networks
--------------------------+------------------
 Reporter:  ddean         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.7
Component:  Multisite     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by jeremyfelt):

 Rereading... what should the expected behavior be when the cast to integer
 occurs on `PRIMARY_NETWORK_ID`?

 {{{
 if ( defined( 'PRIMARY_NETWORK_ID' ) )
     return $network_id === (int) PRIMARY_NETWORK_ID;
 }}}

 Anything not an integer evaluates as 0 and will most likely return as
 false. It may make more sense to fallback on our assumption that 1 is the
 main network at that point by passing it to the next logic block.

 {{{
 if( defined( 'PRIMARY_NETWORK_ID' ) && 0 !== (int) PRIMARY_NETWORK_ID )
     return $network_id === PRIMARY_NETWORK_ID;

 if( 1 === $current_network_id )
     return $network_id === $current_network_id;
 }}}

 [attachment:25030.8.diff] does this and changes the param hint from string
 to int for `$network_id`

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25030#comment:25>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list