Skip to content

Commit

Permalink
Code Modernization: Simplify a conditional in `wp_is_ini_value_change…
Browse files Browse the repository at this point in the history
…able()`.

This commit reverts the code to the code from before the bug fix related to PHP 5.2.6–5.2.17.

As support for PHP 5.2 has been dropped, the workaround for the PHP 5.2 bug is no longer needed.

Follow-up to [38015], [38017], [44950], [45058], [57985], [58678], [58682].

Props jrf, ayeshrajans.
See #61574.

git-svn-id: https://develop.svn.wordpress.org/trunk@58683 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jul 6, 2024
1 parent 9de2177 commit 55e0faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -1679,9 +1679,8 @@ function wp_is_ini_value_changeable( $setting ) {
}
}

// Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
if ( isset( $ini_all[ $setting ]['access'] )
&& ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) )
&& ( INI_ALL === $ini_all[ $setting ]['access'] || INI_USER === $ini_all[ $setting ]['access'] )
) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/load/wpIsIniValueChangeable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function data_wp_is_ini_value_changeable() {
array( 'upload_tmp_dir', false ), // PHP_INI_SYSTEM.
);

if ( PHP_VERSION_ID > 70000 && extension_loaded( 'Tidy' ) ) {
if ( extension_loaded( 'Tidy' ) ) {
$array[] = array( 'tidy.clean_output', true ); // PHP_INI_USER.
}

Expand Down

0 comments on commit 55e0faf

Please sign in to comment.