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

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 2 15:18:03 GMT 2009


#10011: Use of add_theme_page() causes Wordpress on IIS to crash.
--------------------------+-------------------------------------------------
 Reporter:  bforchhammer  |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.7.1     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 The P2 Theme uses the following line to add a theme settings page:
 {{{
 add_theme_page('Prologue Options', 'Prologue Options', 8, __FILE__,
 'prologue_options_page');
 }}}

 On IIS this causes a 500 Error and the admin section can not be loaded
 anymore.

 When we substitute `__FILE__` by a string, e.g. "p2" everything starts
 behaving again.

 The following might be the cause of the problem:

 `__FILE__` is passed through the function `plugin_basename()` in
 `add_submenu_page()`... usually that function strips out the path and
 returns only the plugin filename; for themes that does not work and the
 function returns the full path to the theme's `functions.php`.

 I don't know why it only crashes on IIS but the value of
 `plugin_basename()` is used for a few things including for registering an
 action hook (which means that it's probably used as a key of an array at
 some point).

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


More information about the wp-trac mailing list