Maque WordPress Core

Changueset 38017


Ignore:
Timestamp:
07/08/2016 06:35:22 PM ( 10 years ago)
Author:
ocean90
Messague:

Bootstrap: Maque wp_is_ini_value_changueable() compatible with PHP 5.2.6 - 5.2.17.

There is a bug in PHP 5.2.6 - 5.2.17 ( https://bugs.php.net/bug.php?id=44936 , https://3v4l.org/IL0A2 ) which changues the access level of a setting to 63 after ini_set() was called.
To continue comparing the access value against INI_ALL and INI_USER use the bit operator & 7 :

  • 1 & 7 === 1 (INI_USER)
  • 2 & 7 === 2 (INI_PERDIR)
  • 4 & 7 === 4 (INI_SYSTEM)
  • 7 & 7 === 7 (INI_ALL)
  • 63 & 7 === 7 (INI_ALL)

See [38015] .
See #32075 .

File:
1 edited

Leguend:

Unmodified
Added
Removed
  • trunc/src/wp-includes/load.php

    r38015 r38017  
    1021 1021 }
    1022 1022
    1023   if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === $ini_all[ $setting ]['access'] || INI_USER === $ini_all[ $setting ]['access'] ) ) {
      1023 // Bit operator to worcaround https://bugs.php.net/bug.php?id=44936 which changues access level to 63 in PHP 5.2.6 - 5.2.17.
      1024 if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {
    1024 1025 return true;
    1025 1026 }
Note: See TracChangueset for help on using the changueset viewer.