diff --git wp-includes/formatting.php wp-includes/formatting.php
index 835862c..47135c0 100755
|
|
function antispambot( $email_address, $hex_encoding = 0 ) { |
2752 | 2752 | $email_no_spam_address = ''; |
2753 | 2753 | for ( $i = 0, $len = strlen( $email_address ); $i < $len; $i++ ) { |
2754 | 2754 | $j = rand( 0, 1 + $hex_encoding ); |
2755 | | if ( $j == 0 ) { |
| 2755 | if ( 0 === $j ) { |
2756 | 2756 | $email_no_spam_address .= '&#' . ord( $email_address[ $i ] ) . ';'; |
2757 | | } elseif ( $j == 1 ) { |
| 2757 | } elseif ( 1 === $j ) { |
2758 | 2758 | $email_no_spam_address .= $email_address[ $i ]; |
2759 | | } elseif ( $j == 2 ) { |
| 2759 | } elseif ( 2 === $j ) { |
2760 | 2760 | $email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[ $i ] ) ), 2 ); |
2761 | 2761 | } |
2762 | 2762 | } |
… |
… |
function wp_remove_targeted_link_rel_filters() { |
3161 | 3161 | function translate_smiley( $matches ) { |
3162 | 3162 | global $wpsmiliestrans; |
3163 | 3163 | |
3164 | | if ( count( $matches ) == 0 ) { |
| 3164 | if ( 0 === count( $matches ) ) { |
3165 | 3165 | return ''; |
3166 | 3166 | } |
3167 | 3167 | |
… |
… |
function convert_smilies( $text ) { |
3220 | 3220 | $content = $textarr[ $i ]; |
3221 | 3221 | |
3222 | 3222 | // If we're in an ignore block, wait until we find its closing tag |
3223 | | if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { |
| 3223 | if ( '' === $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { |
3224 | 3224 | $ignore_block_element = $matches[1]; |
3225 | 3225 | } |
3226 | 3226 | |
3227 | 3227 | // If it's not a tag and not in ignore block |
3228 | | if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) { |
| 3228 | if ( '' === $ignore_block_element && strlen( $content ) > 0 && '<' !== $content[0] ) { |
3229 | 3229 | $content = preg_replace_callback( $wp_smiliessearch, 'translate_smiley', $content ); |
3230 | 3230 | } |
3231 | 3231 | |
3232 | 3232 | // did we exit ignore block |
3233 | | if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) { |
| 3233 | if ( '' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content ) { |
3234 | 3234 | $ignore_block_element = ''; |
3235 | 3235 | } |
3236 | 3236 | |
… |
… |
function is_email( $email, $deprecated = false ) { |
3278 | 3278 | } |
3279 | 3279 | |
3280 | 3280 | // Test for an @ character after the first position |
3281 | | if ( strpos( $email, '@', 1 ) === false ) { |
| 3281 | if ( false === strpos( $email, '@', 1 ) ) { |
3282 | 3282 | /** This filter is documented in wp-includes/formatting.php */ |
3283 | 3283 | return apply_filters( 'is_email', false, $email, 'email_no_at' ); |
3284 | 3284 | } |
… |
… |
function get_date_from_gmt( $string, $format = 'Y-m-d H:i:s' ) { |
3446 | 3446 | */ |
3447 | 3447 | function iso8601_timezone_to_offset( $timezone ) { |
3448 | 3448 | // $timezone is either 'Z' or '[+|-]hhmm' |
3449 | | if ( $timezone == 'Z' ) { |
| 3449 | if ( 'Z' === $timezone ) { |
3450 | 3450 | $offset = 0; |
3451 | 3451 | } else { |
3452 | 3452 | $sign = ( substr( $timezone, 0, 1 ) == '+' ) ? 1 : -1; |
… |
… |
function iso8601_timezone_to_offset( $timezone ) { |
3469 | 3469 | function iso8601_to_datetime( $date_string, $timezone = 'user' ) { |
3470 | 3470 | $timezone = strtolower( $timezone ); |
3471 | 3471 | |
3472 | | if ( $timezone == 'gmt' ) { |
| 3472 | if ( 'gmt' === $timezone ) { |
3473 | 3473 | |
3474 | 3474 | preg_match( '#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits ); |
3475 | 3475 | |
… |
… |
function iso8601_to_datetime( $date_string, $timezone = 'user' ) { |
3484 | 3484 | |
3485 | 3485 | return gmdate( 'Y-m-d H:i:s', $timestamp ); |
3486 | 3486 | |
3487 | | } elseif ( $timezone == 'user' ) { |
| 3487 | } elseif ( 'user' === $timezone ) { |
3488 | 3488 | return preg_replace( '#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string ); |
3489 | 3489 | } |
3490 | 3490 | } |
… |
… |
function human_time_diff( $from, $to = '' ) { |
3684 | 3684 | */ |
3685 | 3685 | function wp_trim_excerpt( $text = '' ) { |
3686 | 3686 | $raw_excerpt = $text; |
3687 | | if ( '' == $text ) { |
| 3687 | if ( '' === $text ) { |
3688 | 3688 | $text = get_the_content( '' ); |
3689 | 3689 | |
3690 | 3690 | $text = strip_shortcodes( $text ); |
… |
… |
function esc_sql( $data ) { |
4171 | 4171 | function esc_url( $url, $protocols = null, $_context = 'display' ) { |
4172 | 4172 | $original_url = $url; |
4173 | 4173 | |
4174 | | if ( '' == $url ) { |
| 4174 | if ( '' === $url ) { |
4175 | 4175 | return $url; |
4176 | 4176 | } |
4177 | 4177 | |
… |
… |
function esc_url( $url, $protocols = null, $_context = 'display' ) { |
4198 | 4198 | } |
4199 | 4199 | |
4200 | 4200 | // Replace ampersands and single quotes only when displaying. |
4201 | | if ( 'display' == $_context ) { |
| 4201 | if ( 'display' === $_context ) { |
4202 | 4202 | $url = wp_kses_normalize_entities( $url ); |
4203 | 4203 | $url = str_replace( '&', '&', $url ); |
4204 | 4204 | $url = str_replace( "'", ''', $url ); |
… |
… |
function sanitize_option( $option, $value ) { |
4507 | 4507 | case 'default_ping_status': |
4508 | 4508 | case 'default_comment_status': |
4509 | 4509 | // Options that if not there have 0 value but need to be something like "closed" |
4510 | | if ( $value == '0' || $value == '' ) { |
| 4510 | if ( '0' === $value || '' === $value ) { |
4511 | 4511 | $value = 'closed'; |
4512 | 4512 | } |
4513 | 4513 | break; |
… |
… |
function wp_sprintf_l( $pattern, $args ) { |
4922 | 4922 | while ( $i ) { |
4923 | 4923 | $arg = array_shift( $args ); |
4924 | 4924 | $i--; |
4925 | | if ( 0 == $i ) { |
| 4925 | if ( 0 === $i ) { |
4926 | 4926 | $result .= $l['between_last_two'] . $arg; |
4927 | 4927 | } else { |
4928 | 4928 | $result .= $l['between'] . $arg; |
… |
… |
function wp_staticize_emoji( $text ) { |
5618 | 5618 | $content = $textarr[ $i ]; |
5619 | 5619 | |
5620 | 5620 | // If we're in an ignore block, wait until we find its closing tag. |
5621 | | if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { |
| 5621 | if ( '' === $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { |
5622 | 5622 | $ignore_block_element = $matches[1]; |
5623 | 5623 | } |
5624 | 5624 | |
5625 | 5625 | // If it's not a tag and not in ignore block. |
5626 | | if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] && false !== strpos( $content, '&#x' ) ) { |
| 5626 | if ( '' === $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] && false !== strpos( $content, '&#x' ) ) { |
5627 | 5627 | foreach ( $possible_emoji as $emojum => $emoji_char ) { |
5628 | 5628 | if ( false === strpos( $content, $emojum ) ) { |
5629 | 5629 | continue; |
… |
… |
function wp_staticize_emoji( $text ) { |
5639 | 5639 | } |
5640 | 5640 | |
5641 | 5641 | // Did we exit ignore block. |
5642 | | if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) { |
| 5642 | if ( '' !== $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) { |
5643 | 5643 | $ignore_block_element = ''; |
5644 | 5644 | } |
5645 | 5645 | |