[wp-trac] Re: [WordPress Trac] #5427: WordPress should not include a file indicated by a URL query string that has not been specified in an add_submenu_page call

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 10 00:19:43 GMT 2008


#5427: WordPress should not include a file indicated by a URL query string that
has not been specified in an add_submenu_page call
----------------------------------------+-----------------------------------
 Reporter:  johnbillion                 |        Owner:  anonymous
     Type:  defect                      |       Status:  new      
 Priority:  normal                      |    Milestone:  2.6      
Component:  Administration              |      Version:  2.3.1    
 Severity:  normal                      |   Resolution:           
 Keywords:  add_submenu_page has-patch  |  
----------------------------------------+-----------------------------------
Comment (by DD32):

 It has to loop regardless AFAIK.

 The key for the main menu's is in $menu[ <Keynumber> ][2], and for
 subpages, its in $submenu[ <MainKey> ][ <PageKey> ][2]

 in_array() would only search the main array for the object existing as a
 value, and since its an array in each case, its impossible to tell.  The
 only way to optimize that that i can think of, is to have a seperate array
 of files built when the pages are being added, it could then use
 in_array() to determine if its a valid page.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5427#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list