Opened 9 years ago
Closed 9 years ago
#34526 closed defect (bug) (fixed)
Minor mistake in wp_get_installed_translations function which causes little flood in error log
Reported by: | Profforg | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 3.7 |
Component: | I18N | Keywords: | |
Focuses: | Cc: |
Description
There are a minor mistake in wp_get_installed_translations function in file wp-includes/l10n.php at line 821 (ver 4.3.1) https://github.com/WordPress/WordPress/blob/4.3-branch/wp-includes/l10n.php#L821
Affected versions: 3.7.0 - trunk
Current line:
if ( '.' === $file[0] || is_dir( $file ) ) {
How it should look like:
if ( '.' === $file[0] || is_dir( WP_LANG_DIR . "$dir/$file" ) ) {
Description:
Output of "scandir" function contains only filenames without full path. For some reason on the problematic line this is not taken into account. PHP tries to execute "is_dir" on for example "plugins" which does not work correctly in secured environments if "open_basedir" value is configured.
Example error being logged on each execution of wp_get_installed_translations():
is_dir(): open_basedir restriction in effect. File(plugins) is not within the allowed path(s): ({open_basedir value}) in /var/www/website.com/wp-includes/l10n.php on line 821
Fixed line will execute "is_dir()" on full path which will not return errors and should work in all environments.
In 35856: