[wp-trac] Re: [WordPress Trac] #10011: Use of add_theme_page() causes Wordpress on IIS to crash.

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 5 10:13:31 GMT 2009


#10011: Use of add_theme_page() causes Wordpress on IIS to crash.
--------------------------+-------------------------------------------------
 Reporter:  bforchhammer  |        Type:  defect (bug)
   Status:  new           |    Priority:  normal      
Milestone:  2.8           |   Component:  Plugins     
  Version:  2.7.1         |    Severity:  major       
 Keywords:  needs-patch   |  
--------------------------+-------------------------------------------------

Comment(by bforchhammer):

 Replying to [comment:19 dd32]:
 > My only negitive point to the patch: Not only themes add items under
 there.
 >
 > Perhaps a helper function could be used:
 > {{{
 > function the_base($in) {
 > $plugin = plugin_basename($in);
 > if ( $plugin != $in )
 > return $in;
 > else
 > return theme_basename($in); //No need to check this, a non-theme dir
 passes right through.
 > }
 > }}}
 > and use that for all menu's.
 I am not sure we need a separate function to check because as far as I can
 see non-plugin dirs pass right through `plugin_basename()` as well don't
 they? It should be possible to just use them after each other.

 {{{
 $file = plugin_basename($file);
 $file = theme_basename($file);
 }}}

 Of course if someone would put a completely different path in it would
 fail again and maybe a more general approach would be better?

 Hm, other functions ([/browser/trunk/wp-admin/menu-header.php#L85 menu-
 header.php]) still assume that `$file` is relative to the plugins
 directory so that probably would need to be changed as well.

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


More information about the wp-trac mailing list