| @@ -172,9 +172,19 @@ | ||
| 172 | 172 | * @param mixed $actual Value of the gating constant, or null. |
| 173 | 173 | * @param string $on Gating constant name. |
| 174 | 174 | */ |
| 175 | 175 | $actual = apply_filters( 'xspeed_constant_gate_value', $actual, $on ); |
| 176 | - if ( $actual !== ( $gate['is'] ?? null ) ) { | |
| 176 | + $want = $gate['is'] ?? null; | |
| 177 | + /* | |
| 178 | + * `case_insensitive` is for gates on another plugin's | |
| 179 | + * convention that is read that way at its source: Redis | |
| 180 | + * Object Cache matches WP_REDIS_SCHEME with strcasecmp(), so | |
| 181 | + * `UNIX` is a socket there and has to be one here. (#566) | |
| 182 | + */ | |
| 183 | + $match = ! empty( $gate['case_insensitive'] ) && is_string( $actual ) && is_string( $want ) | |
| 184 | + ? 0 === strcasecmp( $actual, $want ) | |
| 185 | + : $actual === $want; | |
| 186 | + if ( ! $match ) { | |
| 177 | 187 | continue; |
| 178 | 188 | } |
| 179 | 189 | } |
| 180 | 190 | return $name; |