#10132 closed defect (bug) (fixed)
PHP Warning at menu-header.php line 118
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.8.1 | Priority: | high |
Severity: | major | Version: | 2.8 |
Component: | Administration | Keywords: | has-patch tested commit |
Focuses: | Cc: |
Description
After performing a new installation of 2.8-IIS release on machine running PHP under IIS' FastCGI, cannot access wp-admin pages; returns error "open_basedir restriction in effect..." and implicates line 118 of wp-admin/menu-header.php. Checking php.ini, I ensured that safe mode was off, commented-out the open_basedir parameter, and restarted IIS to no avail.
On a whim, I replaced line 118 with its 2.7.1 version, and the problem disappeared! Moreover, after it began working, I returned line 118 to its previous version and it continued to work without error from then on.
Version 2.8:
if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") ) || ! empty($menu_hook) ) {
to Version 2.7.1:
if ( ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") && ('index.php' != $sub_item[2]) ) || ! empty($menu_hook) ) {
Attachments (4)
Change History (29)
#1
@
16 years ago
- Milestone Unassigned deleted
- Resolution set to duplicate
- Status changed from new to closed
#2
@
16 years ago
- Component changed from General to Administration
- Keywords reporter-feedback added
- Resolution duplicate deleted
- Status changed from closed to reopened
Looks like a different issue.
!empty($menu_hook))" and "(file_exists(WP_PLUGIN_DIR."/{$sub_item[2]}") && ('index.php'!=$sub_item[2])) | !empty($menu_hook)" appear the same (although the order is different). |
Would you verify that the change in order has fixed the problem? Also, is the error open_basedir-related?
#4
@
16 years ago
- Milestone set to 2.8.1
- Severity changed from blocker to major
it might be that sub_menu contains ../ in it or something.
#6
@
16 years ago
It's actually related to this:
http://bugs.php.net/bug.php?id=41518
"If we remove this warning for non-existent files, it could be possible
to use file_exists() to detect which files exists (since it's perfectly
legal to print this warning when the file exists)."
#8
@
16 years ago
- Keywords has-patch added
line 118 in r10890 mostly sought to optimize the thingy by inverting the checks, to avoid an unneeded file_exists call.
@creativenadir: please give the patch I'll attach in a sec a shot.
#10
@
16 years ago
- Keywords early dev-feedback added; has-patch removed
- Summary changed from IIS fatal error at menu-header.php line 118 to PHP Warning at menu-header.php line 118
"open_basedir restriction in effect" is never a fatal error, and it is not limited to IIS I think.
To fix it, we have to either ask PHP not to report any Warning or add @ before all file_exists calls. Which method is better?
#11
@
16 years ago
Actually, if error_reporting is set to E_ALL in php.ini, I can't even enter /wp-admin/... The PHP Warning blocked the access.
#13
@
16 years ago
- Keywords has-patch reporter-feedback added; dev-feedback removed
@peaceablewhale: the odd thing is, the patch I uploaded is what the reporter suggested fixed it for him. have you tried it in a setup similar to his?
#14
@
16 years ago
I have tried the patch but it doesn't work. The PHP Warning remains blocking the Admin interface.
#15
@
16 years ago
I have uploaded a patch that uses @file_exists to fix the problem. Tested it with PHP 5.2.9-2 NTS on IIS 7.5 via FastCGI.
By the way, the PHP Warning in full is:
PHP Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(C:\wwwroot\wordpress/wp-content/plugins/edit-tags.php?taxonomy=post_tag) is not within the allowed path(s): (C:\wwwroot) in C:\wwwroot\wordpress\wp-admin\menu-header.php on line 118
#20
@
16 years ago
- Keywords tested added; needs-review removed
Tested 10132.2.diff on PHP 5.2.9-2, IIS 7.5 via FastCGI.
#22
@
16 years ago
Updated the patch to fix submenu highlighting that was broken by a variable naming collision. menu-header.php could stand a thorough cleanup, but let's save that for later.
See #10011