Conditions | 3 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
8 | function jetpack_verification_validate( $verification_services_codes ) { |
||
9 | foreach ( $verification_services_codes as $key => &$code ) { |
||
10 | // Parse html meta tags if present |
||
11 | if ( stripos( $code, 'meta' ) ) |
||
12 | $code = jetpack_verification_get_code( $code ); |
||
13 | |||
14 | $code = esc_attr( trim( $code ) ); |
||
15 | |||
16 | // limit length to 100 chars. |
||
17 | $code = substr( $code, 0, 100 ); |
||
18 | |||
19 | /** |
||
20 | * Fire after each Verification code was validated. |
||
21 | * |
||
22 | * @module verification-tools |
||
23 | * |
||
24 | * @since 3.0.0 |
||
25 | * |
||
26 | * @param string $key Verification service name. |
||
27 | * @param string $code Verification service code provided in field in the Tools menu. |
||
28 | */ |
||
29 | do_action( 'jetpack_site_verification_validate', $key, $code ); |
||
30 | } |
||
31 | return $verification_services_codes; |
||
32 | } |
||
33 | |||
43 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.