Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ function _wptexturize_pushpop_element( $text, &$stack, $disabled_elements ) {
function wpautop( $text, $br = true ) {
$pre_tags = array();

if ( trim( $text ) === '' ) {
if ( '' === trim( $text ) ) {
return '';
}

Expand Down Expand Up @@ -1167,7 +1167,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters =
$unicode .= $encoded_char;
$unicode_length += $encoded_char_length;
} else {
if ( count( $values ) === 0 ) {
if ( 0 === count( $values ) ) {
if ( $value < 224 ) {
$num_octets = 2;
} elseif ( $value < 240 ) {
Expand Down Expand Up @@ -2551,7 +2551,7 @@ function convert_invalid_entities( $content ) {
* @return string Balanced text.
*/
function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
if ( $force || (int) get_option( 'use_balanceTags' ) === 1 ) {
if ( $force || 1 === (int) get_option( 'use_balanceTags' ) ) {
return force_balance_tags( $text );
} else {
return $text;
Expand Down Expand Up @@ -2992,7 +2992,7 @@ function _make_web_ftp_clickable_cb( $matches ) {

// Removed trailing [.,;:)] from URL.
$last_char = substr( $dest, -1 );
if ( in_array( $last_char, array( '.', ',', ';', ':', ')' ), true ) === true ) {
if ( true === in_array( $last_char, array( '.', ',', ';', ':', ')' ), true ) ) {
$ret = $last_char;
$dest = substr( $dest, 0, strlen( $dest ) - 1 );
}
Expand Down Expand Up @@ -3319,7 +3319,7 @@ function wp_targeted_link_rel( $text ) {
_deprecated_function( __FUNCTION__, '6.7.0' );

// Don't run (more expensive) regex if no links with targets.
if ( stripos( $text, 'target' ) === false || stripos( $text, '<a ' ) === false || is_serialized( $text ) ) {
if ( false === stripos( $text, 'target' ) || false === stripos( $text, '<a ' ) || is_serialized( $text ) ) {
return $text;
}

Expand Down Expand Up @@ -3439,7 +3439,7 @@ function wp_remove_targeted_link_rel_filters() {
function translate_smiley( $matches ) {
global $wpsmiliestrans;

if ( count( $matches ) === 0 ) {
if ( 0 === count( $matches ) ) {
return '';
}

Expand Down Expand Up @@ -3565,7 +3565,7 @@ function is_email( $email, $deprecated = false ) {
}

// Test for an @ character after the first position.
if ( strpos( $email, '@', 1 ) === false ) {
if ( false === strpos( $email, '@', 1 ) ) {
/** This filter is documented in wp-includes/formatting.php */
return apply_filters( 'is_email', false, $email, 'email_no_at' );
}
Expand Down Expand Up @@ -3779,7 +3779,7 @@ function sanitize_email( $email ) {
}

// Test for an @ character after the first position.
if ( strpos( $email, '@', 1 ) === false ) {
if ( false === strpos( $email, '@', 1 ) ) {
/** This filter is documented in wp-includes/formatting.php */
return apply_filters( 'sanitize_email', '', $email, 'email_no_at' );
}
Expand Down Expand Up @@ -5351,7 +5351,7 @@ function wp_sprintf_l( $pattern, $args ) {

$args = (array) $args;
$result = array_shift( $args );
if ( count( $args ) === 1 ) {
if ( 1 === count( $args ) ) {
$result .= $l['between_only_two'] . array_shift( $args );
}

Expand Down
Loading