Use of add_theme_page() causes Wordpress on IIS to crash.
|Reported by:||bforchhammer||Owned by:|
|Severity:||major||Keywords:||needs-patch early close|
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).
Change History (42)
comment:1 follow-up: ↓ 3 Denis-de-Bernardy — 5 years ago
- Component changed from General to Plugins
- Keywords needs-patch added
- Milestone changed from Unassigned to 2.8
- Severity changed from normal to major
comment:25 follow-up: ↓ 26 dd32 — 5 years ago
- Keywords early added
- Milestone changed from 2.8 to 2.9