file_exists check in menu-header.php causes issue with backend menu on an IIS server
|Reported by:||chriscct7||Owned by:|
|Severity:||major||Keywords:||2nd-opinion dev-feedback needs-patch|
On line 153 of menu-header.php (based on 3.6 branch), a file_exists check wreaks havok on IIS powered servers.
Let's say $sub_file is either a full url to the intended page, or a admin.php page slug, both valid values for that varible.
In an Apache server, the file_exists, returns false, and WordPress continues along, making the link, which works fine.
On Windows IIS servers, however, the file_exists, when fails, indirectly throws a PHP warning. A good number of Windows based servers use an open_basedir restriction to prevent people from accessing areas they aren't supposed to be in. So, when the filepath inside that file_exists is outside what the user is supposed to be able to access, where the menu item would be, is a PHP warning.
A suggested fix would be to make sure $sub_file is a file (ending in a .php) before running a file_exists check on it.
Issue first detected in 3.5, but probably exists earlier than that (didn't check)