Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r42261 r42343  
    2525 */
    2626function mysql2date( $format, $date, $translate = true ) {
    27     if ( empty( $date ) )
     27    if ( empty( $date ) ) {
    2828        return false;
    29 
    30     if ( 'G' == $format )
     29    }
     30
     31    if ( 'G' == $format ) {
    3132        return strtotime( $date . ' +0000' );
     33    }
    3234
    3335    $i = strtotime( $date );
    3436
    35     if ( 'U' == $format )
     37    if ( 'U' == $format ) {
    3638        return $i;
    37 
    38     if ( $translate )
     39    }
     40
     41    if ( $translate ) {
    3942        return date_i18n( $format, $i );
    40     else
     43    } else {
    4144        return date( $format, $i );
     45    }
    4246}
    4347
     
    101105    $req_format = $dateformatstring;
    102106
    103     if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
    104         $datemonth = $wp_locale->get_month( date( 'm', $i ) );
    105         $datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth );
    106         $dateweekday = $wp_locale->get_weekday( date( 'w', $i ) );
    107         $dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday );
    108         $datemeridiem = $wp_locale->get_meridiem( date( 'a', $i ) );
     107    if ( ( ! empty( $wp_locale->month ) ) && ( ! empty( $wp_locale->weekday ) ) ) {
     108        $datemonth            = $wp_locale->get_month( date( 'm', $i ) );
     109        $datemonth_abbrev     = $wp_locale->get_month_abbrev( $datemonth );
     110        $dateweekday          = $wp_locale->get_weekday( date( 'w', $i ) );
     111        $dateweekday_abbrev   = $wp_locale->get_weekday_abbrev( $dateweekday );
     112        $datemeridiem         = $wp_locale->get_meridiem( date( 'a', $i ) );
    109113        $datemeridiem_capital = $wp_locale->get_meridiem( date( 'A', $i ) );
    110         $dateformatstring = ' '.$dateformatstring;
    111         $dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
    112         $dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
    113         $dateformatstring = preg_replace( "/([^\\\])l/", "\\1" . backslashit( $dateweekday ), $dateformatstring );
    114         $dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
    115         $dateformatstring = preg_replace( "/([^\\\])a/", "\\1" . backslashit( $datemeridiem ), $dateformatstring );
    116         $dateformatstring = preg_replace( "/([^\\\])A/", "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
    117 
    118         $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
    119     }
    120     $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' );
     114        $dateformatstring     = ' ' . $dateformatstring;
     115        $dateformatstring     = preg_replace( '/([^\\\])D/', "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
     116        $dateformatstring     = preg_replace( '/([^\\\])F/', "\\1" . backslashit( $datemonth ), $dateformatstring );
     117        $dateformatstring     = preg_replace( '/([^\\\])l/', "\\1" . backslashit( $dateweekday ), $dateformatstring );
     118        $dateformatstring     = preg_replace( '/([^\\\])M/', "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
     119        $dateformatstring     = preg_replace( '/([^\\\])a/', "\\1" . backslashit( $datemeridiem ), $dateformatstring );
     120        $dateformatstring     = preg_replace( '/([^\\\])A/', "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
     121
     122        $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) - 1 );
     123    }
     124    $timezone_formats    = array( 'P', 'I', 'O', 'T', 'Z', 'e' );
    121125    $timezone_formats_re = implode( '|', $timezone_formats );
    122126    if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) ) {
     
    124128        if ( $timezone_string ) {
    125129            $timezone_object = timezone_open( $timezone_string );
    126             $date_object = date_create( null, $timezone_object );
     130            $date_object     = date_create( null, $timezone_object );
    127131            foreach ( $timezone_formats as $timezone_format ) {
    128132                if ( false !== strpos( $dateformatstring, $timezone_format ) ) {
    129                     $formatted = date_format( $date_object, $timezone_format );
    130                     $dateformatstring = ' '.$dateformatstring;
     133                    $formatted        = date_format( $date_object, $timezone_format );
     134                    $dateformatstring = ' ' . $dateformatstring;
    131135                    $dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring );
    132                     $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
     136                    $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) - 1 );
    133137                }
    134138            }
     
    304308    $weekday = date( 'w', $day );
    305309
    306     if ( !is_numeric($start_of_week) )
     310    if ( ! is_numeric( $start_of_week ) ) {
    307311        $start_of_week = get_option( 'start_of_week' );
    308 
    309     if ( $weekday < $start_of_week )
     312    }
     313
     314    if ( $weekday < $start_of_week ) {
    310315        $weekday += 7;
     316    }
    311317
    312318    // The most recent week start day on or before $day.
     
    327333 */
    328334function maybe_unserialize( $original ) {
    329     if ( is_serialized( $original ) ) // don't attempt to unserialize data that wasn't serialized going in
     335    if ( is_serialized( $original ) ) { // don't attempt to unserialize data that wasn't serialized going in
    330336        return @unserialize( $original );
     337    }
    331338    return $original;
    332339}
     
    350357    }
    351358    $data = trim( $data );
    352     if ( 'N;' == $data ) {
     359    if ( 'N;' == $data ) {
    353360        return true;
    354361    }
     
    368375        $brace     = strpos( $data, '}' );
    369376        // Either ; or } must exist.
    370         if ( false === $semicolon && false === $brace )
     377        if ( false === $semicolon && false === $brace ) {
    371378            return false;
     379        }
    372380        // But neither must be in the first X characters.
    373         if ( false !== $semicolon && $semicolon < 3 )
     381        if ( false !== $semicolon && $semicolon < 3 ) {
    374382            return false;
    375         if ( false !== $brace && $brace < 4 )
     383        }
     384        if ( false !== $brace && $brace < 4 ) {
    376385            return false;
     386        }
    377387    }
    378388    $token = $data[0];
    379389    switch ( $token ) {
    380         case 's' :
     390        case 's':
    381391            if ( $strict ) {
    382392                if ( '"' !== substr( $data, -2, 1 ) ) {
     
    387397            }
    388398            // or else fall through
    389         case 'a' :
    390         case 'O' :
     399        case 'a':
     400        case 'O':
    391401            return (bool) preg_match( "/^{$token}:[0-9]+:/s", $data );
    392         case 'b' :
    393         case 'i' :
    394         case 'd' :
     402        case 'b':
     403        case 'i':
     404        case 'd':
    395405            $end = $strict ? '$' : '';
    396406            return (bool) preg_match( "/^{$token}:[0-9.E-]+;$end/", $data );
     
    437447 */
    438448function maybe_serialize( $data ) {
    439     if ( is_array( $data ) || is_object( $data ) )
     449    if ( is_array( $data ) || is_object( $data ) ) {
    440450        return serialize( $data );
     451    }
    441452
    442453    // Double serialization is required for backward compatibility.
    443454    // See https://core.trac.wordpress.org/ticket/12930
    444455    // Also the world will end. See WP 3.6.1.
    445     if ( is_serialized( $data, false ) )
     456    if ( is_serialized( $data, false ) ) {
    446457        return serialize( $data );
     458    }
    447459
    448460    return $data;
     
    523535    preg_match_all(
    524536        "#([\"']?)("
    525             . "(?:([\w-]+:)?//?)"
    526             . "[^\s()<>]+"
    527             . "[.]"
    528             . "(?:"
    529                 . "\([\w\d]+\)|"
    530                 . "(?:"
     537            . '(?:([\w-]+:)?//?)'
     538            . '[^\s()<>]+'
     539            . '[.]'
     540            . '(?:'
     541                . '\([\w\d]+\)|'
     542                . '(?:'
    531543                    . "[^`!()\[\]{};:'\".,<>«»“”‘’\s]|"
    532                     . "(?:[:]\d+)?/?"
    533                 . ")+"
    534             . ")"
     544                    . '(?:[:]\d+)?/?'
     545                . ')+'
     546            . ')'
    535547        . ")\\1#",
    536548        $content,
     
    571583    foreach ( $pung as $link_test ) {
    572584        if ( ! in_array( $link_test, $post_links_temp ) ) { // link no longer in post
    573             $mids = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $link_test ) . '%') );
    574             foreach ( $mids as $mid )
     585            $mids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $link_test ) . '%' ) );
     586            foreach ( $mids as $mid ) {
    575587                delete_metadata_by_mid( 'post', $mid );
     588            }
    576589        }
    577590    }
    578591
    579592    foreach ( (array) $post_links_temp as $link_test ) {
    580         if ( !in_array( $link_test, $pung ) ) { // If we haven't pung it already
     593        if ( ! in_array( $link_test, $pung ) ) { // If we haven't pung it already
    581594            $test = @parse_url( $link_test );
    582             if ( false === $test )
     595            if ( false === $test ) {
    583596                continue;
    584             if ( isset( $test['query'] ) )
     597            }
     598            if ( isset( $test['query'] ) ) {
    585599                $post_links[] = $link_test;
    586             elseif ( isset($test['path']) && ( $test['path'] != '/' ) &&  ($test['path'] != '' ) )
     600            } elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) && ( $test['path'] != '' ) ) {
    587601                $post_links[] = $link_test;
     602            }
    588603        }
    589604    }
     
    603618
    604619    foreach ( (array) $post_links as $url ) {
    605         if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $url ) . '%' ) ) ) {
    606 
    607             if ( $headers = wp_get_http_headers( $url) ) {
    608                 $len = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0;
    609                 $type = isset( $headers['content-type'] ) ? $headers['content-type'] : '';
     620        if ( $url != '' && ! $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $url ) . '%' ) ) ) {
     621
     622            if ( $headers = wp_get_http_headers( $url ) ) {
     623                $len           = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0;
     624                $type          = isset( $headers['content-type'] ) ? $headers['content-type'] : '';
    610625                $allowed_types = array( 'video', 'audio' );
    611626
     
    615630                if ( false !== $url_parts ) {
    616631                    $extension = pathinfo( $url_parts['path'], PATHINFO_EXTENSION );
    617                     if ( !empty( $extension ) ) {
     632                    if ( ! empty( $extension ) ) {
    618633                        foreach ( wp_get_mime_types() as $exts => $mime ) {
    619634                            if ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) {
     
    625640                }
    626641
    627                 if ( in_array( substr( $type, 0, strpos( $type, "/" ) ), $allowed_types ) ) {
     642                if ( in_array( substr( $type, 0, strpos( $type, '/' ) ), $allowed_types ) ) {
    628643                    add_post_meta( $post_ID, 'enclosure', "$url\n$len\n$mime\n" );
    629644                }
     
    643658 */
    644659function wp_get_http_headers( $url, $deprecated = false ) {
    645     if ( !empty( $deprecated ) )
     660    if ( ! empty( $deprecated ) ) {
    646661        _deprecated_argument( __FUNCTION__, '2.7.0' );
     662    }
    647663
    648664    $response = wp_safe_remote_head( $url );
    649665
    650     if ( is_wp_error( $response ) )
     666    if ( is_wp_error( $response ) ) {
    651667        return false;
     668    }
    652669
    653670    return wp_remote_retrieve_headers( $response );
     
    667684function is_new_day() {
    668685    global $currentday, $previousday;
    669     if ( $currentday != $previousday )
     686    if ( $currentday != $previousday ) {
    670687        return 1;
    671     else
     688    } else {
    672689        return 0;
     690    }
    673691}
    674692
     
    683701 * @see _http_build_query() Used to build the query
    684702 * @link https://secure.php.net/manual/en/function.http-build-query.php for more on what
    685  *      http_build_query() does.
     703 *      http_build_query() does.
    686704 *
    687705 * @param array $data URL-encode key/value pairs.
     
    714732
    715733    foreach ( (array) $data as $k => $v ) {
    716         if ( $urlencode)
    717             $k = urlencode($k);
    718         if ( is_int($k) && $prefix != null )
    719             $k = $prefix.$k;
    720         if ( !empty($key) )
     734        if ( $urlencode ) {
     735            $k = urlencode( $k );
     736        }
     737        if ( is_int( $k ) && $prefix != null ) {
     738            $k = $prefix . $k;
     739        }
     740        if ( ! empty( $key ) ) {
    721741            $k = $key . '%5B' . $k . '%5D';
    722         if ( $v === null )
     742        }
     743        if ( $v === null ) {
    723744            continue;
    724         elseif ( $v === false )
     745        } elseif ( $v === false ) {
    725746            $v = '0';
    726 
    727         if ( is_array($v) || is_object($v) )
    728             array_push($ret,_http_build_query($v, '', $sep, $k, $urlencode));
    729         elseif ( $urlencode )
    730             array_push($ret, $k.'='.urlencode($v));
    731         else
    732             array_push($ret, $k.'='.$v);
    733     }
    734 
    735     if ( null === $sep )
    736         $sep = ini_get('arg_separator.output');
    737 
    738     return implode($sep, $ret);
     747        }
     748
     749        if ( is_array( $v ) || is_object( $v ) ) {
     750            array_push( $ret, _http_build_query( $v, '', $sep, $k, $urlencode ) );
     751        } elseif ( $urlencode ) {
     752            array_push( $ret, $k . '=' . urlencode( $v ) );
     753        } else {
     754            array_push( $ret, $k . '=' . $v );
     755        }
     756    }
     757
     758    if ( null === $sep ) {
     759        $sep = ini_get( 'arg_separator.output' );
     760    }
     761
     762    return implode( $sep, $ret );
    739763}
    740764
     
    777801    $args = func_get_args();
    778802    if ( is_array( $args[0] ) ) {
    779         if ( count( $args ) < 2 || false === $args[1] )
     803        if ( count( $args ) < 2 || false === $args[1] ) {
    780804            $uri = $_SERVER['REQUEST_URI'];
    781         else
     805        } else {
    782806            $uri = $args[1];
     807        }
    783808    } else {
    784         if ( count( $args ) < 3 || false === $args[2] )
     809        if ( count( $args ) < 3 || false === $args[2] ) {
    785810            $uri = $_SERVER['REQUEST_URI'];
    786         else
     811        } else {
    787812            $uri = $args[2];
    788     }
    789 
    790     if ( $frag = strstr( $uri, '#' ) )
     813        }
     814    }
     815
     816    if ( $frag = strstr( $uri, '#' ) ) {
    791817        $uri = substr( $uri, 0, -strlen( $frag ) );
    792     else
     818    } else {
    793819        $frag = '';
     820    }
    794821
    795822    if ( 0 === stripos( $uri, 'http://' ) ) {
    796823        $protocol = 'http://';
    797         $uri = substr( $uri, 7 );
     824        $uri      = substr( $uri, 7 );
    798825    } elseif ( 0 === stripos( $uri, 'https://' ) ) {
    799826        $protocol = 'https://';
    800         $uri = substr( $uri, 8 );
     827        $uri      = substr( $uri, 8 );
    801828    } else {
    802829        $protocol = '';
     
    805832    if ( strpos( $uri, '?' ) !== false ) {
    806833        list( $base, $query ) = explode( '?', $uri, 2 );
    807         $base .= '?';
     834        $base                .= '?';
    808835    } elseif ( $protocol || strpos( $uri, '=' ) === false ) {
    809         $base = $uri . '?';
     836        $base  = $uri . '?';
    810837        $query = '';
    811838    } else {
    812         $base = '';
     839        $base  = '';
    813840        $query = $uri;
    814841    }
     
    825852
    826853    foreach ( $qs as $k => $v ) {
    827         if ( $v === false )
    828             unset( $qs[$k] );
     854        if ( $v === false ) {
     855            unset( $qs[ $k ] );
     856        }
    829857    }
    830858
     
    848876function remove_query_arg( $key, $query = false ) {
    849877    if ( is_array( $key ) ) { // removing multiple keys
    850         foreach ( $key as $k )
     878        foreach ( $key as $k ) {
    851879            $query = add_query_arg( $k, false, $query );
     880        }
    852881        return $query;
    853882    }
     
    910939    foreach ( (array) $array as $k => $v ) {
    911940        if ( is_array( $v ) ) {
    912             $array[$k] = add_magic_quotes( $v );
     941            $array[ $k ] = add_magic_quotes( $v );
    913942        } else {
    914             $array[$k] = addslashes( $v );
     943            $array[ $k ] = addslashes( $v );
    915944        }
    916945    }
     
    931960    $parsed_url = @parse_url( $uri );
    932961
    933     if ( !$parsed_url || !is_array( $parsed_url ) )
     962    if ( ! $parsed_url || ! is_array( $parsed_url ) ) {
    934963        return false;
    935 
    936     $options = array();
     964    }
     965
     966    $options            = array();
    937967    $options['timeout'] = 10;
    938968
    939969    $response = wp_safe_remote_get( $uri, $options );
    940970
    941     if ( is_wp_error( $response ) )
     971    if ( is_wp_error( $response ) ) {
    942972        return false;
     973    }
    943974
    944975    return wp_remote_retrieve_body( $response );
     
    960991    $wp->main( $query_vars );
    961992
    962     if ( !isset($wp_the_query) )
     993    if ( ! isset( $wp_the_query ) ) {
    963994        $wp_the_query = $wp_query;
     995    }
    964996}
    965997
     
    9821014    $code = absint( $code );
    9831015
    984     if ( !isset( $wp_header_to_desc ) ) {
     1016    if ( ! isset( $wp_header_to_desc ) ) {
    9851017        $wp_header_to_desc = array(
    9861018            100 => 'Continue',
     
    10511083    }
    10521084
    1053     if ( isset( $wp_header_to_desc[$code] ) )
    1054         return $wp_header_to_desc[$code];
    1055     else
     1085    if ( isset( $wp_header_to_desc[ $code ] ) ) {
     1086        return $wp_header_to_desc[ $code ];
     1087    } else {
    10561088        return '';
     1089    }
    10571090}
    10581091
     
    10771110    }
    10781111
    1079     $protocol = wp_get_server_protocol();
     1112    $protocol      = wp_get_server_protocol();
    10801113    $status_header = "$protocol $code $description";
    1081     if ( function_exists( 'apply_filters' ) )
     1114    if ( function_exists( 'apply_filters' ) ) {
    10821115
    10831116        /**
     
    10921125         */
    10931126        $status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol );
     1127    }
    10941128
    10951129    @header( $status_header, true, $code );
     
    11081142function wp_get_nocache_headers() {
    11091143    $headers = array(
    1110         'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT',
     1144        'Expires'       => 'Wed, 11 Jan 1984 05:00:00 GMT',
    11111145        'Cache-Control' => 'no-cache, must-revalidate, max-age=0',
    11121146    );
    11131147
    1114     if ( function_exists('apply_filters') ) {
     1148    if ( function_exists( 'apply_filters' ) ) {
    11151149        /**
    11161150         * Filters the cache-controlling headers.
     
    11631197    }
    11641198
    1165     foreach ( $headers as $name => $field_value )
    1166         @header("{$name}: {$field_value}");
     1199    foreach ( $headers as $name => $field_value ) {
     1200        @header( "{$name}: {$field_value}" );
     1201    }
    11671202}
    11681203
     
    11751210    $expiresOffset = 10 * DAY_IN_SECONDS;
    11761211
    1177     header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) );
    1178     header( "Vary: Accept-Encoding" ); // Handle proxies
    1179     header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . " GMT" );
     1212    header( 'Content-Type: text/javascript; charset=' . get_bloginfo( 'charset' ) );
     1213    header( 'Vary: Accept-Encoding' ); // Handle proxies
     1214    header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expiresOffset ) . ' GMT' );
    11801215}
    11811216
     
    12281263    $feed = preg_replace( '/^_+/', '', $feed );
    12291264
    1230     if ( $feed == '' || $feed == 'feed' )
     1265    if ( $feed == '' || $feed == 'feed' ) {
    12311266        $feed = get_default_feed();
     1267    }
    12321268
    12331269    if ( ! has_action( "do_feed_{$feed}" ) ) {
     
    12821318 */
    12831319function do_feed_rss2( $for_comments ) {
    1284     if ( $for_comments )
     1320    if ( $for_comments ) {
    12851321        load_template( ABSPATH . WPINC . '/feed-rss2-comments.php' );
    1286     else
     1322    } else {
    12871323        load_template( ABSPATH . WPINC . '/feed-rss2.php' );
     1324    }
    12881325}
    12891326
     
    12981335 */
    12991336function do_feed_atom( $for_comments ) {
    1300     if ($for_comments)
    1301         load_template( ABSPATH . WPINC . '/feed-atom-comments.php');
    1302     else
     1337    if ( $for_comments ) {
     1338        load_template( ABSPATH . WPINC . '/feed-atom-comments.php' );
     1339    } else {
    13031340        load_template( ABSPATH . WPINC . '/feed-atom.php' );
     1341    }
    13041342}
    13051343
     
    13281366    } else {
    13291367        $site_url = parse_url( site_url() );
    1330         $path = ( !empty( $site_url['path'] ) ) ? $site_url['path'] : '';
    1331         $output .= "Disallow: $path/wp-admin/\n";
    1332         $output .= "Allow: $path/wp-admin/admin-ajax.php\n";
     1368        $path     = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : '';
     1369        $output  .= "Disallow: $path/wp-admin/\n";
     1370        $output  .= "Allow: $path/wp-admin/admin-ajax.php\n";
    13331371    }
    13341372
     
    13661404     * cached, oh well.
    13671405     */
    1368     if ( wp_cache_get( 'is_blog_installed' ) )
     1406    if ( wp_cache_get( 'is_blog_installed' ) ) {
    13691407        return true;
     1408    }
    13701409
    13711410    $suppress = $wpdb->suppress_errors();
     
    13741413    }
    13751414    // If siteurl is not set to autoload, check it specifically
    1376     if ( !isset( $alloptions['siteurl'] ) )
     1415    if ( ! isset( $alloptions['siteurl'] ) ) {
    13771416        $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
    1378     else
     1417    } else {
    13791418        $installed = $alloptions['siteurl'];
     1419    }
    13801420    $wpdb->suppress_errors( $suppress );
    13811421
    1382     $installed = !empty( $installed );
     1422    $installed = ! empty( $installed );
    13831423    wp_cache_set( 'is_blog_installed', $installed );
    13841424
    1385     if ( $installed )
     1425    if ( $installed ) {
    13861426        return true;
     1427    }
    13871428
    13881429    // If visiting repair.php, return true and let it take over.
    1389     if ( defined( 'WP_REPAIRING' ) )
     1430    if ( defined( 'WP_REPAIRING' ) ) {
    13901431        return true;
     1432    }
    13911433
    13921434    $suppress = $wpdb->suppress_errors();
     
    14001442    foreach ( $wp_tables as $table ) {
    14011443        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
    1402         if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table )
     1444        if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table ) {
    14031445            continue;
    1404         if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table )
     1446        }
     1447        if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table ) {
    14051448            continue;
    1406 
    1407         if ( ! $wpdb->get_results( "DESCRIBE $table;" ) )
     1449        }
     1450
     1451        if ( ! $wpdb->get_results( "DESCRIBE $table;" ) ) {
    14081452            continue;
     1453        }
    14091454
    14101455        // One or more tables exist. We are insane.
     
    14701515 * @return string Nonce field HTML markup.
    14711516 */
    1472 function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) {
    1473     $name = esc_attr( $name );
     1517function wp_nonce_field( $action = -1, $name = '_wpnonce', $referer = true, $echo = true ) {
     1518    $name        = esc_attr( $name );
    14741519    $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />';
    14751520
    1476     if ( $referer )
     1521    if ( $referer ) {
    14771522        $nonce_field .= wp_referer_field( false );
    1478 
    1479     if ( $echo )
     1523    }
     1524
     1525    if ( $echo ) {
    14801526        echo $nonce_field;
     1527    }
    14811528
    14821529    return $nonce_field;
     
    14951542 */
    14961543function wp_referer_field( $echo = true ) {
    1497     $referer_field = '<input type="hidden" name="_wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
    1498 
    1499     if ( $echo )
     1544    $referer_field = '<input type="hidden" name="_wp_http_referer" value="' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
     1545
     1546    if ( $echo ) {
    15001547        echo $referer_field;
     1548    }
    15011549    return $referer_field;
    15021550}
     
    15211569    }
    15221570    $orig_referer_field = '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( $ref ) . '" />';
    1523     if ( $echo )
     1571    if ( $echo ) {
    15241572        echo $orig_referer_field;
     1573    }
    15251574    return $orig_referer_field;
    15261575}
     
    15611610    if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
    15621611        return wp_unslash( $_REQUEST['_wp_http_referer'] );
    1563     } else if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
     1612    } elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
    15641613        return wp_unslash( $_SERVER['HTTP_REFERER'] );
    15651614    }
     
    15761625 */
    15771626function wp_get_original_referer() {
    1578     if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) )
     1627    if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) ) {
    15791628        return wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false );
     1629    }
    15801630    return false;
    15811631}
     
    16111661     * Use rtrim() instead of untrailingslashit to avoid formatting.php dependency.
    16121662     */
    1613     $target = rtrim($target, '/');
    1614     if ( empty($target) )
     1663    $target = rtrim( $target, '/' );
     1664    if ( empty( $target ) ) {
    16151665        $target = '/';
    1616 
    1617     if ( file_exists( $target ) )
     1666    }
     1667
     1668    if ( file_exists( $target ) ) {
    16181669        return @is_dir( $target );
     1670    }
    16191671
    16201672    // We need to find the permissions of the parent folder that exists and inherit that.
     
    16651717     * a symbolic link.
    16661718     */
    1667     if ( realpath($path) == $path )
     1719    if ( realpath( $path ) == $path ) {
    16681720        return true;
    1669 
    1670     if ( strlen($path) == 0 || $path[0] == '.' )
     1721    }
     1722
     1723    if ( strlen( $path ) == 0 || $path[0] == '.' ) {
    16711724        return false;
     1725    }
    16721726
    16731727    // Windows allows absolute paths like this.
    1674     if ( preg_match('#^[a-zA-Z]:\\\\#', $path) )
     1728    if ( preg_match( '#^[a-zA-Z]:\\\\#', $path ) ) {
    16751729        return true;
     1730    }
    16761731
    16771732    // A path starting with / or \ is absolute; anything else is relative.
     
    16921747 */
    16931748function path_join( $base, $path ) {
    1694     if ( path_is_absolute($path) )
     1749    if ( path_is_absolute( $path ) ) {
    16951750        return $path;
    1696 
    1697     return rtrim($base, '/') . '/' . ltrim($path, '/');
     1751    }
     1752
     1753    return rtrim( $base, '/' ) . '/' . ltrim( $path, '/' );
    16981754}
    16991755
     
    17401796function get_temp_dir() {
    17411797    static $temp = '';
    1742     if ( defined('WP_TEMP_DIR') )
    1743         return trailingslashit(WP_TEMP_DIR);
    1744 
    1745     if ( $temp )
     1798    if ( defined( 'WP_TEMP_DIR' ) ) {
     1799        return trailingslashit( WP_TEMP_DIR );
     1800    }
     1801
     1802    if ( $temp ) {
    17461803        return trailingslashit( $temp );
    1747 
    1748     if ( function_exists('sys_get_temp_dir') ) {
     1804    }
     1805
     1806    if ( function_exists( 'sys_get_temp_dir' ) ) {
    17491807        $temp = sys_get_temp_dir();
    1750         if ( @is_dir( $temp ) && wp_is_writable( $temp ) )
     1808        if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) {
    17511809            return trailingslashit( $temp );
    1752     }
    1753 
    1754     $temp = ini_get('upload_tmp_dir');
    1755     if ( @is_dir( $temp ) && wp_is_writable( $temp ) )
     1810        }
     1811    }
     1812
     1813    $temp = ini_get( 'upload_tmp_dir' );
     1814    if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) {
    17561815        return trailingslashit( $temp );
     1816    }
    17571817
    17581818    $temp = WP_CONTENT_DIR . '/';
    1759     if ( is_dir( $temp ) && wp_is_writable( $temp ) )
     1819    if ( is_dir( $temp ) && wp_is_writable( $temp ) ) {
    17601820        return $temp;
     1821    }
    17611822
    17621823    return '/tmp/';
     
    17771838 */
    17781839function wp_is_writable( $path ) {
    1779     if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) )
     1840    if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
    17801841        return win_is_writable( $path );
    1781     else
     1842    } else {
    17821843        return @is_writable( $path );
     1844    }
    17831845}
    17841846
     
    18011863function win_is_writable( $path ) {
    18021864
    1803     if ( $path[strlen( $path ) - 1] == '/' ) { // if it looks like a directory, check a random file within the directory
    1804         return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp');
     1865    if ( $path[ strlen( $path ) - 1 ] == '/' ) { // if it looks like a directory, check a random file within the directory
     1866        return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp' );
    18051867    } elseif ( is_dir( $path ) ) { // If it's a directory (and not a file) check a random file within the directory
    18061868        return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
    18071869    }
    18081870    // check tmp file for read/write capabilities
    1809     $should_delete_tmp_file = !file_exists( $path );
    1810     $f = @fopen( $path, 'a' );
    1811     if ( $f === false )
     1871    $should_delete_tmp_file = ! file_exists( $path );
     1872    $f                      = @fopen( $path, 'a' );
     1873    if ( $f === false ) {
    18121874        return false;
     1875    }
    18131876    fclose( $f );
    1814     if ( $should_delete_tmp_file )
     1877    if ( $should_delete_tmp_file ) {
    18151878        unlink( $path );
     1879    }
    18161880    return true;
    18171881}
     
    19291993 */
    19301994function _wp_upload_dir( $time = null ) {
    1931     $siteurl = get_option( 'siteurl' );
     1995    $siteurl     = get_option( 'siteurl' );
    19321996    $upload_path = trim( get_option( 'upload_path' ) );
    19331997
     
    19412005    }
    19422006
    1943     if ( !$url = get_option( 'upload_url_path' ) ) {
    1944         if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) )
     2007    if ( ! $url = get_option( 'upload_url_path' ) ) {
     2008        if ( empty( $upload_path ) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) ) {
    19452009            $url = WP_CONTENT_URL . '/uploads';
    1946         else
     2010        } else {
    19472011            $url = trailingslashit( $siteurl ) . $upload_path;
     2012        }
    19482013    }
    19492014
     
    19702035             */
    19712036
    1972             if ( defined( 'MULTISITE' ) )
     2037            if ( defined( 'MULTISITE' ) ) {
    19732038                $ms_dir = '/sites/' . get_current_blog_id();
    1974             else
     2039            } else {
    19752040                $ms_dir = '/' . get_current_blog_id();
     2041            }
    19762042
    19772043            $dir .= $ms_dir;
     
    19932059             */
    19942060
    1995             if ( defined( 'BLOGUPLOADDIR' ) )
     2061            if ( defined( 'BLOGUPLOADDIR' ) ) {
    19962062                $dir = untrailingslashit( BLOGUPLOADDIR );
    1997             else
     2063            } else {
    19982064                $dir = ABSPATH . UPLOADS;
     2065            }
    19992066            $url = trailingslashit( $siteurl ) . 'files';
    20002067        }
     
    20072074    if ( get_option( 'uploads_use_yearmonth_folders' ) ) {
    20082075        // Generate the yearly and monthly dirs
    2009         if ( !$time )
     2076        if ( ! $time ) {
    20102077            $time = current_time( 'mysql' );
    2011         $y = substr( $time, 0, 4 );
    2012         $m = substr( $time, 5, 2 );
     2078        }
     2079        $y      = substr( $time, 0, 4 );
     2080        $m      = substr( $time, 5, 2 );
    20132081        $subdir = "/$y/$m";
    20142082    }
     
    20462114function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) {
    20472115    // Sanitize the file name before we begin processing.
    2048     $filename = sanitize_file_name($filename);
     2116    $filename = sanitize_file_name( $filename );
    20492117
    20502118    // Separate the filename into a name and extension.
    2051     $ext = pathinfo( $filename, PATHINFO_EXTENSION );
     2119    $ext  = pathinfo( $filename, PATHINFO_EXTENSION );
    20522120    $name = pathinfo( $filename, PATHINFO_BASENAME );
    20532121    if ( $ext ) {
     
    20702138
    20712139        // Change '.ext' to lower case.
    2072         if ( $ext && strtolower($ext) != $ext ) {
    2073             $ext2 = strtolower($ext);
    2074             $filename2 = preg_replace( '|' . preg_quote($ext) . '$|', $ext2, $filename );
     2140        if ( $ext && strtolower( $ext ) != $ext ) {
     2141            $ext2      = strtolower( $ext );
     2142            $filename2 = preg_replace( '|' . preg_quote( $ext ) . '$|', $ext2, $filename );
    20752143
    20762144            // Check for both lower and upper case extension or image sub-sizes may be overwritten.
    2077             while ( file_exists($dir . "/$filename") || file_exists($dir . "/$filename2") ) {
     2145            while ( file_exists( $dir . "/$filename" ) || file_exists( $dir . "/$filename2" ) ) {
    20782146                $new_number = (int) $number + 1;
    2079                 $filename = str_replace( array( "-$number$ext", "$number$ext" ), "-$new_number$ext", $filename );
    2080                 $filename2 = str_replace( array( "-$number$ext2", "$number$ext2" ), "-$new_number$ext2", $filename2 );
    2081                 $number = $new_number;
     2147                $filename   = str_replace( array( "-$number$ext", "$number$ext" ), "-$new_number$ext", $filename );
     2148                $filename2  = str_replace( array( "-$number$ext2", "$number$ext2" ), "-$new_number$ext2", $filename2 );
     2149                $number     = $new_number;
    20822150            }
    20832151
     
    21002168                $filename = "$filename-" . $new_number;
    21012169            } else {
    2102                 $filename = str_replace( array( "-$number$ext", "$number$ext" ), "-" . $new_number . $ext, $filename );
     2170                $filename = str_replace( array( "-$number$ext", "$number$ext" ), '-' . $new_number . $ext, $filename );
    21032171            }
    21042172            $number = $new_number;
     
    21342202 */
    21352203function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
    2136     if ( !empty( $deprecated ) )
     2204    if ( ! empty( $deprecated ) ) {
    21372205        _deprecated_argument( __FUNCTION__, '2.0.0' );
    2138 
    2139     if ( empty( $name ) )
     2206    }
     2207
     2208    if ( empty( $name ) ) {
    21402209        return array( 'error' => __( 'Empty filename' ) );
     2210    }
    21412211
    21422212    $wp_filetype = wp_check_filetype( $name );
    2143     if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) )
     2213    if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) {
    21442214        return array( 'error' => __( 'Sorry, this file type is not permitted for security reasons.' ) );
     2215    }
    21452216
    21462217    $upload = wp_upload_dir( $time );
    21472218
    2148     if ( $upload['error'] !== false )
     2219    if ( $upload['error'] !== false ) {
    21492220        return $upload;
     2221    }
    21502222
    21512223    /**
     
    21592231     * @param mixed $upload_bits_error An array of upload bits data, or a non-array error to return.
    21602232     */
    2161     $upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' => $name, 'bits' => $bits, 'time' => $time ) );
    2162     if ( !is_array( $upload_bits_error ) ) {
    2163         $upload[ 'error' ] = $upload_bits_error;
     2233    $upload_bits_error = apply_filters(
     2234        'wp_upload_bits', array(
     2235            'name' => $name,
     2236            'bits' => $bits,
     2237            'time' => $time,
     2238        )
     2239    );
     2240    if ( ! is_array( $upload_bits_error ) ) {
     2241        $upload['error'] = $upload_bits_error;
    21642242        return $upload;
    21652243    }
     
    21692247    $new_file = $upload['path'] . "/$filename";
    21702248    if ( ! wp_mkdir_p( dirname( $new_file ) ) ) {
    2171         if ( 0 === strpos( $upload['basedir'], ABSPATH ) )
     2249        if ( 0 === strpos( $upload['basedir'], ABSPATH ) ) {
    21722250            $error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir'];
    2173         else
     2251        } else {
    21742252            $error_path = basename( $upload['basedir'] ) . $upload['subdir'];
     2253        }
    21752254
    21762255        $message = sprintf(
     
    21832262
    21842263    $ifp = @ fopen( $new_file, 'wb' );
    2185     if ( ! $ifp )
     2264    if ( ! $ifp ) {
    21862265        return array( 'error' => sprintf( __( 'Could not write file %s' ), $new_file ) );
     2266    }
    21872267
    21882268    @fwrite( $ifp, $bits );
     
    21912271
    21922272    // Set correct file permissions
    2193     $stat = @ stat( dirname( $new_file ) );
     2273    $stat  = @ stat( dirname( $new_file ) );
    21942274    $perms = $stat['mode'] & 0007777;
    21952275    $perms = $perms & 0000666;
     
    22012281
    22022282    /** This filter is documented in wp-admin/includes/file.php */
    2203     return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $wp_filetype['type'], 'error' => false ), 'sideload' );
     2283    return apply_filters(
     2284        'wp_handle_upload', array(
     2285            'file'  => $new_file,
     2286            'url'   => $url,
     2287            'type'  => $wp_filetype['type'],
     2288            'error' => false,
     2289        ), 'sideload'
     2290    );
    22042291}
    22052292
     
    22162303
    22172304    $ext2type = wp_get_ext_types();
    2218     foreach ( $ext2type as $type => $exts )
    2219         if ( in_array( $ext, $exts ) )
     2305    foreach ( $ext2type as $type => $exts ) {
     2306        if ( in_array( $ext, $exts ) ) {
    22202307            return $type;
     2308        }
     2309    }
    22212310}
    22222311
     
    22332322 */
    22342323function wp_check_filetype( $filename, $mimes = null ) {
    2235     if ( empty($mimes) )
     2324    if ( empty( $mimes ) ) {
    22362325        $mimes = get_allowed_mime_types();
     2326    }
    22372327    $type = false;
    2238     $ext = false;
     2328    $ext  = false;
    22392329
    22402330    foreach ( $mimes as $ext_preg => $mime_match ) {
     
    22422332        if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
    22432333            $type = $mime_match;
    2244             $ext = $ext_matches[1];
     2334            $ext  = $ext_matches[1];
    22452335            break;
    22462336        }
     
    22742364    // Do basic extension validation and MIME mapping
    22752365    $wp_filetype = wp_check_filetype( $filename, $mimes );
    2276     $ext = $wp_filetype['ext'];
    2277     $type = $wp_filetype['type'];
     2366    $ext         = $wp_filetype['ext'];
     2367    $type        = $wp_filetype['type'];
    22782368
    22792369    // We can't do any further validation without a file to work with
     
    22982388             * @param  array $mime_to_ext Array of image mime types and their matching extensions.
    22992389             */
    2300             $mime_to_ext = apply_filters( 'getimagesize_mimes_to_exts', array(
    2301                 'image/jpeg' => 'jpg',
    2302                 'image/png'  => 'png',
    2303                 'image/gif'  => 'gif',
    2304                 'image/bmp'  => 'bmp',
    2305                 'image/tiff' => 'tif',
    2306             ) );
     2390            $mime_to_ext = apply_filters(
     2391                'getimagesize_mimes_to_exts', array(
     2392                    'image/jpeg' => 'jpg',
     2393                    'image/png'  => 'png',
     2394                    'image/gif'  => 'gif',
     2395                    'image/bmp'  => 'bmp',
     2396                    'image/tiff' => 'tif',
     2397                )
     2398            );
    23072399
    23082400            // Replace whatever is after the last period in the filename with the correct extension
     
    23112403                array_pop( $filename_parts );
    23122404                $filename_parts[] = $mime_to_ext[ $real_mime ];
    2313                 $new_filename = implode( '.', $filename_parts );
     2405                $new_filename     = implode( '.', $filename_parts );
    23142406
    23152407                if ( $new_filename != $filename ) {
     
    23182410                // Redefine the extension / MIME
    23192411                $wp_filetype = wp_check_filetype( $new_filename, $mimes );
    2320                 $ext = $wp_filetype['ext'];
    2321                 $type = $wp_filetype['type'];
     2412                $ext         = $wp_filetype['ext'];
     2413                $type        = $wp_filetype['type'];
    23222414            } else {
    23232415                // Reset $real_mime and try validating again.
     
    23292421    // Validate files that didn't get validated during previous checks.
    23302422    if ( $type && ! $real_mime && extension_loaded( 'fileinfo' ) ) {
    2331         $finfo = finfo_open( FILEINFO_MIME_TYPE );
     2423        $finfo     = finfo_open( FILEINFO_MIME_TYPE );
    23322424        $real_mime = finfo_file( $finfo, $file );
    23332425        finfo_close( $finfo );
     
    23812473        if ( is_callable( 'exif_imagetype' ) ) {
    23822474            $imagetype = exif_imagetype( $file );
    2383             $mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false;
     2475            $mime      = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false;
    23842476        } elseif ( function_exists( 'getimagesize' ) ) {
    23852477            $imagesize = getimagesize( $file );
    2386             $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
     2478            $mime      = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
    23872479        } else {
    23882480            $mime = false;
     
    24152507     *                                 corresponding to those types.
    24162508     */
    2417     return apply_filters( 'mime_types', array(
    2418     // Image formats.
    2419     'jpg|jpeg|jpe' => 'image/jpeg',
    2420     'gif' => 'image/gif',
    2421     'png' => 'image/png',
    2422     'bmp' => 'image/bmp',
    2423     'tiff|tif' => 'image/tiff',
    2424     'ico' => 'image/x-icon',
    2425     // Video formats.
    2426     'asf|asx' => 'video/x-ms-asf',
    2427     'wmv' => 'video/x-ms-wmv',
    2428     'wmx' => 'video/x-ms-wmx',
    2429     'wm' => 'video/x-ms-wm',
    2430     'avi' => 'video/avi',
    2431     'divx' => 'video/divx',
    2432     'flv' => 'video/x-flv',
    2433     'mov|qt' => 'video/quicktime',
    2434     'mpeg|mpg|mpe' => 'video/mpeg',
    2435     'mp4|m4v' => 'video/mp4',
    2436     'ogv' => 'video/ogg',
    2437     'webm' => 'video/webm',
    2438     'mkv' => 'video/x-matroska',
    2439     '3gp|3gpp' => 'video/3gpp', // Can also be audio
    2440     '3g2|3gp2' => 'video/3gpp2', // Can also be audio
    2441     // Text formats.
    2442     'txt|asc|c|cc|h|srt' => 'text/plain',
    2443     'csv' => 'text/csv',
    2444     'tsv' => 'text/tab-separated-values',
    2445     'ics' => 'text/calendar',
    2446     'rtx' => 'text/richtext',
    2447     'css' => 'text/css',
    2448     'htm|html' => 'text/html',
    2449     'vtt' => 'text/vtt',
    2450     'dfxp' => 'application/ttaf+xml',
    2451     // Audio formats.
    2452     'mp3|m4a|m4b' => 'audio/mpeg',
    2453     'ra|ram' => 'audio/x-realaudio',
    2454     'wav' => 'audio/wav',
    2455     'ogg|oga' => 'audio/ogg',
    2456     'mid|midi' => 'audio/midi',
    2457     'wma' => 'audio/x-ms-wma',
    2458     'wax' => 'audio/x-ms-wax',
    2459     'mka' => 'audio/x-matroska',
    2460     // Misc application formats.
    2461     'rtf' => 'application/rtf',
    2462     'js' => 'application/javascript',
    2463     'pdf' => 'application/pdf',
    2464     'swf' => 'application/x-shockwave-flash',
    2465     'class' => 'application/java',
    2466     'tar' => 'application/x-tar',
    2467     'zip' => 'application/zip',
    2468     'gz|gzip' => 'application/x-gzip',
    2469     'rar' => 'application/rar',
    2470     '7z' => 'application/x-7z-compressed',
    2471     'exe' => 'application/x-msdownload',
    2472     'psd' => 'application/octet-stream',
    2473     'xcf' => 'application/octet-stream',
    2474     // MS Office formats.
    2475     'doc' => 'application/msword',
    2476     'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
    2477     'wri' => 'application/vnd.ms-write',
    2478     'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
    2479     'mdb' => 'application/vnd.ms-access',
    2480     'mpp' => 'application/vnd.ms-project',
    2481     'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
    2482     'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
    2483     'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
    2484     'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
    2485     'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
    2486     'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
    2487     'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
    2488     'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
    2489     'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
    2490     'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
    2491     'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
    2492     'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
    2493     'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
    2494     'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
    2495     'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
    2496     'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
    2497     'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
    2498     'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
    2499     'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12',
    2500     'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
    2501     'oxps' => 'application/oxps',
    2502     'xps' => 'application/vnd.ms-xpsdocument',
    2503     // OpenOffice formats.
    2504     'odt' => 'application/vnd.oasis.opendocument.text',
    2505     'odp' => 'application/vnd.oasis.opendocument.presentation',
    2506     'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
    2507     'odg' => 'application/vnd.oasis.opendocument.graphics',
    2508     'odc' => 'application/vnd.oasis.opendocument.chart',
    2509     'odb' => 'application/vnd.oasis.opendocument.database',
    2510     'odf' => 'application/vnd.oasis.opendocument.formula',
    2511     // WordPerfect formats.
    2512     'wp|wpd' => 'application/wordperfect',
    2513     // iWork formats.
    2514     'key' => 'application/vnd.apple.keynote',
    2515     'numbers' => 'application/vnd.apple.numbers',
    2516     'pages' => 'application/vnd.apple.pages',
    2517     ) );
     2509    return apply_filters(
     2510        'mime_types', array(
     2511            // Image formats.
     2512            'jpg|jpeg|jpe'                 => 'image/jpeg',
     2513            'gif'                          => 'image/gif',
     2514            'png'                          => 'image/png',
     2515            'bmp'                          => 'image/bmp',
     2516            'tiff|tif'                     => 'image/tiff',
     2517            'ico'                          => 'image/x-icon',
     2518            // Video formats.
     2519            'asf|asx'                      => 'video/x-ms-asf',
     2520            'wmv'                          => 'video/x-ms-wmv',
     2521            'wmx'                          => 'video/x-ms-wmx',
     2522            'wm'                           => 'video/x-ms-wm',
     2523            'avi'                          => 'video/avi',
     2524            'divx'                         => 'video/divx',
     2525            'flv'                          => 'video/x-flv',
     2526            'mov|qt'                       => 'video/quicktime',
     2527            'mpeg|mpg|mpe'                 => 'video/mpeg',
     2528            'mp4|m4v'                      => 'video/mp4',
     2529            'ogv'                          => 'video/ogg',
     2530            'webm'                         => 'video/webm',
     2531            'mkv'                          => 'video/x-matroska',
     2532            '3gp|3gpp'                     => 'video/3gpp', // Can also be audio
     2533            '3g2|3gp2'                     => 'video/3gpp2', // Can also be audio
     2534            // Text formats.
     2535            'txt|asc|c|cc|h|srt'           => 'text/plain',
     2536            'csv'                          => 'text/csv',
     2537            'tsv'                          => 'text/tab-separated-values',
     2538            'ics'                          => 'text/calendar',
     2539            'rtx'                          => 'text/richtext',
     2540            'css'                          => 'text/css',
     2541            'htm|html'                     => 'text/html',
     2542            'vtt'                          => 'text/vtt',
     2543            'dfxp'                         => 'application/ttaf+xml',
     2544            // Audio formats.
     2545            'mp3|m4a|m4b'                  => 'audio/mpeg',
     2546            'ra|ram'                       => 'audio/x-realaudio',
     2547            'wav'                          => 'audio/wav',
     2548            'ogg|oga'                      => 'audio/ogg',
     2549            'mid|midi'                     => 'audio/midi',
     2550            'wma'                          => 'audio/x-ms-wma',
     2551            'wax'                          => 'audio/x-ms-wax',
     2552            'mka'                          => 'audio/x-matroska',
     2553            // Misc application formats.
     2554            'rtf'                          => 'application/rtf',
     2555            'js'                           => 'application/javascript',
     2556            'pdf'                          => 'application/pdf',
     2557            'swf'                          => 'application/x-shockwave-flash',
     2558            'class'                        => 'application/java',
     2559            'tar'                          => 'application/x-tar',
     2560            'zip'                          => 'application/zip',
     2561            'gz|gzip'                      => 'application/x-gzip',
     2562            'rar'                          => 'application/rar',
     2563            '7z'                           => 'application/x-7z-compressed',
     2564            'exe'                          => 'application/x-msdownload',
     2565            'psd'                          => 'application/octet-stream',
     2566            'xcf'                          => 'application/octet-stream',
     2567            // MS Office formats.
     2568            'doc'                          => 'application/msword',
     2569            'pot|pps|ppt'                  => 'application/vnd.ms-powerpoint',
     2570            'wri'                          => 'application/vnd.ms-write',
     2571            'xla|xls|xlt|xlw'              => 'application/vnd.ms-excel',
     2572            'mdb'                          => 'application/vnd.ms-access',
     2573            'mpp'                          => 'application/vnd.ms-project',
     2574            'docx'                         => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
     2575            'docm'                         => 'application/vnd.ms-word.document.macroEnabled.12',
     2576            'dotx'                         => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
     2577            'dotm'                         => 'application/vnd.ms-word.template.macroEnabled.12',
     2578            'xlsx'                         => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
     2579            'xlsm'                         => 'application/vnd.ms-excel.sheet.macroEnabled.12',
     2580            'xlsb'                         => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
     2581            'xltx'                         => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
     2582            'xltm'                         => 'application/vnd.ms-excel.template.macroEnabled.12',
     2583            'xlam'                         => 'application/vnd.ms-excel.addin.macroEnabled.12',
     2584            'pptx'                         => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
     2585            'pptm'                         => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
     2586            'ppsx'                         => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
     2587            'ppsm'                         => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
     2588            'potx'                         => 'application/vnd.openxmlformats-officedocument.presentationml.template',
     2589            'potm'                         => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
     2590            'ppam'                         => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
     2591            'sldx'                         => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
     2592            'sldm'                         => 'application/vnd.ms-powerpoint.slide.macroEnabled.12',
     2593            'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
     2594            'oxps'                         => 'application/oxps',
     2595            'xps'                          => 'application/vnd.ms-xpsdocument',
     2596            // OpenOffice formats.
     2597            'odt'                          => 'application/vnd.oasis.opendocument.text',
     2598            'odp'                          => 'application/vnd.oasis.opendocument.presentation',
     2599            'ods'                          => 'application/vnd.oasis.opendocument.spreadsheet',
     2600            'odg'                          => 'application/vnd.oasis.opendocument.graphics',
     2601            'odc'                          => 'application/vnd.oasis.opendocument.chart',
     2602            'odb'                          => 'application/vnd.oasis.opendocument.database',
     2603            'odf'                          => 'application/vnd.oasis.opendocument.formula',
     2604            // WordPerfect formats.
     2605            'wp|wpd'                       => 'application/wordperfect',
     2606            // iWork formats.
     2607            'key'                          => 'application/vnd.apple.keynote',
     2608            'numbers'                      => 'application/vnd.apple.numbers',
     2609            'pages'                        => 'application/vnd.apple.pages',
     2610        )
     2611    );
    25182612}
    25192613
     
    25372631     *                        of file types.
    25382632     */
    2539     return apply_filters( 'ext2type', array(
    2540         'image'       => array( 'jpg', 'jpeg', 'jpe',  'gif',  'png',  'bmp',   'tif',  'tiff', 'ico' ),
    2541         'audio'       => array( 'aac', 'ac3',  'aif',  'aiff', 'm3a',  'm4a',   'm4b',  'mka',  'mp1',  'mp2',  'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
    2542         'video'       => array( '3g2',  '3gp', '3gpp', 'asf', 'avi',  'divx', 'dv',   'flv',  'm4v',   'mkv',  'mov',  'mp4',  'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt',  'rm', 'vob', 'wmv' ),
    2543         'document'    => array( 'doc', 'docx', 'docm', 'dotm', 'odt',  'pages', 'pdf',  'xps',  'oxps', 'rtf',  'wp', 'wpd', 'psd', 'xcf' ),
    2544         'spreadsheet' => array( 'numbers',     'ods',  'xls',  'xlsx', 'xlsm',  'xlsb' ),
    2545         'interactive' => array( 'swf', 'key',  'ppt',  'pptx', 'pptm', 'pps',   'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ),
    2546         'text'        => array( 'asc', 'csv',  'tsv',  'txt' ),
    2547         'archive'     => array( 'bz2', 'cab',  'dmg',  'gz',   'rar',  'sea',   'sit',  'sqx',  'tar',  'tgz',  'zip', '7z' ),
    2548         'code'        => array( 'css', 'htm',  'html', 'php',  'js' ),
    2549     ) );
     2633    return apply_filters(
     2634        'ext2type', array(
     2635            'image'       => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ),
     2636            'audio'       => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
     2637            'video'       => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
     2638            'document'    => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ),
     2639            'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ),
     2640            'interactive' => array( 'swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ),
     2641            'text'        => array( 'asc', 'csv', 'tsv', 'txt' ),
     2642            'archive'     => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ),
     2643            'code'        => array( 'css', 'htm', 'html', 'php', 'js' ),
     2644        )
     2645    );
    25502646}
    25512647
     
    25632659
    25642660    unset( $t['swf'], $t['exe'] );
    2565     if ( function_exists( 'current_user_can' ) )
     2661    if ( function_exists( 'current_user_can' ) ) {
    25662662        $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
     2663    }
    25672664
    25682665    if ( empty( $unfiltered ) ) {
     
    26002697            get_bloginfo( 'name' )
    26012698        );
    2602         $html .= '</p><p>';
     2699        $html       .= '</p><p>';
    26032700        $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
    2604         $html .= sprintf(
     2701        $html       .= sprintf(
    26052702            /* translators: %s: logout URL */
    26062703            __( 'Do you really want to <a href="%s">log out</a>?' ),
     
    26112708        if ( wp_get_referer() ) {
    26122709            $html .= '</p><p>';
    2613             $html .= sprintf( '<a href="%s">%s</a>',
     2710            $html .= sprintf(
     2711                '<a href="%s">%s</a>',
    26142712                esc_url( remove_query_arg( 'updated', wp_get_referer() ) ),
    26152713                __( 'Please try again.' )
     
    27112809function _default_wp_die_handler( $message, $title = '', $args = array() ) {
    27122810    $defaults = array( 'response' => 500 );
    2713     $r = wp_parse_args($args, $defaults);
    2714 
    2715     $have_gettext = function_exists('__');
     2811    $r        = wp_parse_args( $args, $defaults );
     2812
     2813    $have_gettext = function_exists( '__' );
    27162814
    27172815    if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
    27182816        if ( empty( $title ) ) {
    27192817            $error_data = $message->get_error_data();
    2720             if ( is_array( $error_data ) && isset( $error_data['title'] ) )
     2818            if ( is_array( $error_data ) && isset( $error_data['title'] ) ) {
    27212819                $title = $error_data['title'];
     2820            }
    27222821        }
    27232822        $errors = $message->get_error_messages();
    27242823        switch ( count( $errors ) ) {
    2725         case 0 :
    2726             $message = '';
    2727             break;
    2728         case 1 :
    2729             $message = "<p>{$errors[0]}</p>";
    2730             break;
    2731         default :
    2732             $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>";
    2733             break;
     2824            case 0:
     2825                $message = '';
     2826                break;
     2827            case 1:
     2828                $message = "<p>{$errors[0]}</p>";
     2829                break;
     2830            default:
     2831                $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>";
     2832                break;
    27342833        }
    27352834    } elseif ( is_string( $message ) ) {
     
    27382837
    27392838    if ( isset( $r['back_link'] ) && $r['back_link'] ) {
    2740         $back_text = $have_gettext? __('&laquo; Back') : '&laquo; Back';
    2741         $message .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>";
     2839        $back_text = $have_gettext ? __( '&laquo; Back' ) : '&laquo; Back';
     2840        $message  .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>";
    27422841    }
    27432842
    27442843    if ( ! did_action( 'admin_head' ) ) :
    2745         if ( !headers_sent() ) {
     2844        if ( ! headers_sent() ) {
    27462845            status_header( $r['response'] );
    27472846            nocache_headers();
     
    27492848        }
    27502849
    2751         if ( empty($title) )
    2752             $title = $have_gettext ? __('WordPress &rsaquo; Error') : 'WordPress &rsaquo; Error';
     2850        if ( empty( $title ) ) {
     2851            $title = $have_gettext ? __( 'WordPress &rsaquo; Error' ) : 'WordPress &rsaquo; Error';
     2852        }
    27532853
    27542854        $text_direction = 'ltr';
    2755         if ( isset($r['text_direction']) && 'rtl' == $r['text_direction'] )
     2855        if ( isset( $r['text_direction'] ) && 'rtl' == $r['text_direction'] ) {
    27562856            $text_direction = 'rtl';
    2757         elseif ( function_exists( 'is_rtl' ) && is_rtl() )
     2857        } elseif ( function_exists( 'is_rtl' ) && is_rtl() ) {
    27582858            $text_direction = 'rtl';
    2759 
    2760             if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) {
    2761                 $dir_attr = get_language_attributes();
    2762             } else {
    2763                 $dir_attr = "dir='$text_direction'";
    2764             }
     2859        }
     2860
     2861        if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) {
     2862            $dir_attr = get_language_attributes();
     2863        } else {
     2864            $dir_attr = "dir='$text_direction'";
     2865        }
    27652866?>
    27662867<!DOCTYPE html>
     
    27742875    }
    27752876    ?>
    2776     <title><?php echo $title ?></title>
     2877    <title><?php echo $title; ?></title>
    27772878    <style type="text/css">
    27782879        html {
     
    28222923        a:focus {
    28232924            color: #124964;
    2824             -webkit-box-shadow:
    2825                 0 0 0 1px #5b9dd9,
     2925            -webkit-box-shadow:
     2926                0 0 0 1px #5b9dd9,
    28262927                0 0 2px 1px rgba(30, 140, 190, .8);
    2827             box-shadow:
    2828                 0 0 0 1px #5b9dd9,
     2928            box-shadow:
     2929                0 0 0 1px #5b9dd9,
    28292930                0 0 2px 1px rgba(30, 140, 190, .8);
    28302931            outline: none;
     
    28522953            -webkit-box-shadow: 0 1px 0 #ccc;
    28532954            box-shadow: 0 1px 0 #ccc;
    2854             vertical-align: top;
     2955             vertical-align: top;
    28552956        }
    28562957
     
    28782979            background: #eee;
    28792980            border-color: #999;
    2880             -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
    2881             box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
    2882             -webkit-transform: translateY(1px);
    2883             -ms-transform: translateY(1px);
    2884             transform: translateY(1px);
     2981             -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
     2982             box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
     2983             -webkit-transform: translateY(1px);
     2984             -ms-transform: translateY(1px);
     2985             transform: translateY(1px);
    28852986        }
    28862987
     
    29193020    $defaults = array( 'response' => 500 );
    29203021
    2921     $r = wp_parse_args($args, $defaults);
     3022    $r = wp_parse_args( $args, $defaults );
    29223023
    29233024    if ( $wp_xmlrpc_server ) {
    2924         $error = new IXR_Error( $r['response'] , $message);
     3025        $error = new IXR_Error( $r['response'], $message );
    29253026        $wp_xmlrpc_server->output( $error->getXml() );
    29263027    }
     
    29443045        'response' => 200,
    29453046    );
    2946     $r = wp_parse_args( $args, $defaults );
     3047    $r        = wp_parse_args( $args, $defaults );
    29473048
    29483049    if ( ! headers_sent() && null !== $r['response'] ) {
     
    29503051    }
    29513052
    2952     if ( is_scalar( $message ) )
     3053    if ( is_scalar( $message ) ) {
    29533054        die( (string) $message );
     3055    }
    29543056    die( '0' );
    29553057}
     
    29663068 */
    29673069function _scalar_wp_die_handler( $message = '' ) {
    2968     if ( is_scalar( $message ) )
     3070    if ( is_scalar( $message ) ) {
    29693071        die( (string) $message );
     3072    }
    29703073    die();
    29713074}
     
    30043107    // ... unless we're in an old version of PHP, and json_encode() returned
    30053108    // a string containing 'null'. Then we need to do more sanity checking.
    3006     if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) )  {
     3109    if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) ) {
    30073110        return $json;
    30083111    }
     
    31803283
    31813284    if ( wp_doing_ajax() ) {
    3182         wp_die( '', '', array(
    3183             'response' => null,
    3184         ) );
     3285        wp_die(
     3286            '', '', array(
     3287                'response' => null,
     3288            )
     3289        );
    31853290    } else {
    31863291        die;
     
    32003305    $response = array( 'success' => true );
    32013306
    3202     if ( isset( $data ) )
     3307    if ( isset( $data ) ) {
    32033308        $response['data'] = $data;
     3309    }
    32043310
    32053311    wp_send_json( $response, $status_code );
     
    32293335            foreach ( $data->errors as $code => $messages ) {
    32303336                foreach ( $messages as $message ) {
    3231                     $result[] = array( 'code' => $code, 'message' => $message );
     3337                    $result[] = array(
     3338                        'code'    => $code,
     3339                        'message' => $message,
     3340                    );
    32323341                }
    32333342            }
     
    32803389 */
    32813390function _config_wp_home( $url = '' ) {
    3282     if ( defined( 'WP_HOME' ) )
     3391    if ( defined( 'WP_HOME' ) ) {
    32833392        return untrailingslashit( WP_HOME );
     3393    }
    32843394    return $url;
    32853395}
     
    33013411 */
    33023412function _config_wp_siteurl( $url = '' ) {
    3303     if ( defined( 'WP_SITEURL' ) )
     3413    if ( defined( 'WP_SITEURL' ) ) {
    33043414        return untrailingslashit( WP_SITEURL );
     3415    }
    33053416    return $url;
    33063417}
     
    33363447    if ( is_rtl() ) {
    33373448        $mce_init['directionality'] = 'rtl';
    3338         $mce_init['rtl_ui'] = true;
     3449        $mce_init['rtl_ui']         = true;
    33393450
    33403451        if ( ! empty( $mce_init['plugins'] ) && strpos( $mce_init['plugins'], 'directionality' ) === false ) {
     
    33773488
    33783489    // don't bother setting up smilies if they are disabled
    3379     if ( !get_option( 'use_smilies' ) )
     3490    if ( ! get_option( 'use_smilies' ) ) {
    33803491        return;
    3381 
    3382     if ( !isset( $wpsmiliestrans ) ) {
     3492    }
     3493
     3494    if ( ! isset( $wpsmiliestrans ) ) {
    33833495        $wpsmiliestrans = array(
    3384         ':mrgreen:' => 'mrgreen.png',
    3385         ':neutral:' => "\xf0\x9f\x98\x90",
    3386         ':twisted:' => "\xf0\x9f\x98\x88",
    3387         ':arrow:' => "\xe2\x9e\xa1",
    3388         ':shock:' => "\xf0\x9f\x98\xaf",
    3389         ':smile:' => "\xf0\x9f\x99\x82",
    3390         ':???:' => "\xf0\x9f\x98\x95",
    3391         ':cool:' => "\xf0\x9f\x98\x8e",
    3392         ':evil:' => "\xf0\x9f\x91\xbf",
    3393         ':grin:' => "\xf0\x9f\x98\x80",
    3394         ':idea:' => "\xf0\x9f\x92\xa1",
    3395         ':oops:' => "\xf0\x9f\x98\xb3",
    3396         ':razz:' => "\xf0\x9f\x98\x9b",
    3397         ':roll:' => "\xf0\x9f\x99\x84",
    3398         ':wink:' => "\xf0\x9f\x98\x89",
    3399         ':cry:' => "\xf0\x9f\x98\xa5",
    3400         ':eek:' => "\xf0\x9f\x98\xae",
    3401         ':lol:' => "\xf0\x9f\x98\x86",
    3402         ':mad:' => "\xf0\x9f\x98\xa1",
    3403         ':sad:' => "\xf0\x9f\x99\x81",
    3404         '8-)' => "\xf0\x9f\x98\x8e",
    3405         '8-O' => "\xf0\x9f\x98\xaf",
    3406         ':-(' => "\xf0\x9f\x99\x81",
    3407         ':-)' => "\xf0\x9f\x99\x82",
    3408         ':-?' => "\xf0\x9f\x98\x95",
    3409         ':-D' => "\xf0\x9f\x98\x80",
    3410         ':-P' => "\xf0\x9f\x98\x9b",
    3411         ':-o' => "\xf0\x9f\x98\xae",
    3412         ':-x' => "\xf0\x9f\x98\xa1",
    3413         ':-|' => "\xf0\x9f\x98\x90",
    3414         ';-)' => "\xf0\x9f\x98\x89",
    3415         // This one transformation breaks regular text with frequency.
    3416         //     '8)' => "\xf0\x9f\x98\x8e",
    3417         '8O' => "\xf0\x9f\x98\xaf",
    3418         ':(' => "\xf0\x9f\x99\x81",
    3419         ':)' => "\xf0\x9f\x99\x82",
    3420         ':?' => "\xf0\x9f\x98\x95",
    3421         ':D' => "\xf0\x9f\x98\x80",
    3422         ':P' => "\xf0\x9f\x98\x9b",
    3423         ':o' => "\xf0\x9f\x98\xae",
    3424         ':x' => "\xf0\x9f\x98\xa1",
    3425         ':|' => "\xf0\x9f\x98\x90",
    3426         ';)' => "\xf0\x9f\x98\x89",
    3427         ':!:' => "\xe2\x9d\x97",
    3428         ':?:' => "\xe2\x9d\x93",
     3496            ':mrgreen:' => 'mrgreen.png',
     3497            ':neutral:' => "\xf0\x9f\x98\x90",
     3498            ':twisted:' => "\xf0\x9f\x98\x88",
     3499            ':arrow:'  => "\xe2\x9e\xa1",
     3500            ':shock:'  => "\xf0\x9f\x98\xaf",
     3501            ':smile:'  => "\xf0\x9f\x99\x82",
     3502            ':???:'    => "\xf0\x9f\x98\x95",
     3503            ':cool:'    => "\xf0\x9f\x98\x8e",
     3504            ':evil:'    => "\xf0\x9f\x91\xbf",
     3505            ':grin:'    => "\xf0\x9f\x98\x80",
     3506            ':idea:'    => "\xf0\x9f\x92\xa1",
     3507            ':oops:'    => "\xf0\x9f\x98\xb3",
     3508            ':razz:'    => "\xf0\x9f\x98\x9b",
     3509            ':roll:'    => "\xf0\x9f\x99\x84",
     3510            ':wink:'    => "\xf0\x9f\x98\x89",
     3511            ':cry:'    => "\xf0\x9f\x98\xa5",
     3512            ':eek:'    => "\xf0\x9f\x98\xae",
     3513            ':lol:'    => "\xf0\x9f\x98\x86",
     3514            ':mad:'    => "\xf0\x9f\x98\xa1",
     3515            ':sad:'    => "\xf0\x9f\x99\x81",
     3516            '8-)'      => "\xf0\x9f\x98\x8e",
     3517            '8-O'      => "\xf0\x9f\x98\xaf",
     3518            ':-('      => "\xf0\x9f\x99\x81",
     3519            ':-)'      => "\xf0\x9f\x99\x82",
     3520            ':-?'      => "\xf0\x9f\x98\x95",
     3521            ':-D'      => "\xf0\x9f\x98\x80",
     3522            ':-P'      => "\xf0\x9f\x98\x9b",
     3523            ':-o'      => "\xf0\x9f\x98\xae",
     3524            ':-x'      => "\xf0\x9f\x98\xa1",
     3525            ':-|'      => "\xf0\x9f\x98\x90",
     3526            ';-)'      => "\xf0\x9f\x98\x89",
     3527            // This one transformation breaks regular text with frequency.
     3528            //     '8)' => "\xf0\x9f\x98\x8e",
     3529            '8O'        => "\xf0\x9f\x98\xaf",
     3530            ':('        => "\xf0\x9f\x99\x81",
     3531            ':)'        => "\xf0\x9f\x99\x82",
     3532            ':?'        => "\xf0\x9f\x98\x95",
     3533            ':D'        => "\xf0\x9f\x98\x80",
     3534            ':P'        => "\xf0\x9f\x98\x9b",
     3535            ':o'        => "\xf0\x9f\x98\xae",
     3536            ':x'        => "\xf0\x9f\x98\xa1",
     3537            ':|'        => "\xf0\x9f\x98\x90",
     3538            ';)'        => "\xf0\x9f\x98\x89",
     3539            ':!:'      => "\xe2\x9d\x97",
     3540            ':?:'      => "\xe2\x9d\x93",
    34293541        );
    34303542    }
     
    34403552     * @param array $wpsmiliestrans List of the smilies.
    34413553     */
    3442     $wpsmiliestrans = apply_filters('smilies', $wpsmiliestrans);
    3443 
    3444     if (count($wpsmiliestrans) == 0) {
     3554    $wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
     3555
     3556    if ( count( $wpsmiliestrans ) == 0 ) {
    34453557        return;
    34463558    }
     
    34513563     * expression used below is first-match
    34523564     */
    3453     krsort($wpsmiliestrans);
     3565    krsort( $wpsmiliestrans );
    34543566
    34553567    $spaces = wp_spaces_regexp();
     
    34603572    $subchar = '';
    34613573    foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
    3462         $firstchar = substr($smiley, 0, 1);
    3463         $rest = substr($smiley, 1);
     3574        $firstchar = substr( $smiley, 0, 1 );
     3575        $rest      = substr( $smiley, 1 );
    34643576
    34653577        // new subpattern?
    3466         if ($firstchar != $subchar) {
    3467             if ($subchar != '') {
     3578        if ( $firstchar != $subchar ) {
     3579            if ( $subchar != '' ) {
    34683580                $wp_smiliessearch .= ')(?=' . $spaces . '|$)';  // End previous "subpattern"
    34693581                $wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern"
    34703582            }
    3471             $subchar = $firstchar;
    3472             $wp_smiliessearch .= preg_quote($firstchar, '/') . '(?:';
     3583            $subchar           = $firstchar;
     3584            $wp_smiliessearch .= preg_quote( $firstchar, '/' ) . '(?:';
    34733585        } else {
    34743586            $wp_smiliessearch .= '|';
    34753587        }
    3476         $wp_smiliessearch .= preg_quote($rest, '/');
     3588        $wp_smiliessearch .= preg_quote( $rest, '/' );
    34773589    }
    34783590
     
    34953607 */
    34963608function wp_parse_args( $args, $defaults = '' ) {
    3497     if ( is_object( $args ) )
     3609    if ( is_object( $args ) ) {
    34983610        $r = get_object_vars( $args );
    3499     elseif ( is_array( $args ) )
     3611    } elseif ( is_array( $args ) ) {
    35003612        $r =& $args;
    3501     else
     3613    } else {
    35023614        wp_parse_str( $args, $r );
    3503 
    3504     if ( is_array( $defaults ) )
     3615    }
     3616
     3617    if ( is_array( $defaults ) ) {
    35053618        return array_merge( $defaults, $r );
     3619    }
    35063620    return $r;
    35073621}
     
    35163630 */
    35173631function wp_parse_id_list( $list ) {
    3518     if ( !is_array($list) )
    3519         $list = preg_split('/[\s,]+/', $list);
    3520 
    3521     return array_unique(array_map('absint', $list));
     3632    if ( ! is_array( $list ) ) {
     3633        $list = preg_split( '/[\s,]+/', $list );
     3634    }
     3635
     3636    return array_unique( array_map( 'absint', $list ) );
    35223637}
    35233638
     
    35533668function wp_array_slice_assoc( $array, $keys ) {
    35543669    $slice = array();
    3555     foreach ( $keys as $key )
    3556         if ( isset( $array[ $key ] ) )
     3670    foreach ( $keys as $key ) {
     3671        if ( isset( $array[ $key ] ) ) {
    35573672            $slice[ $key ] = $array[ $key ];
     3673        }
     3674    }
    35583675
    35593676    return $slice;
     
    35733690    }
    35743691
    3575     $keys = array_keys( $data );
     3692    $keys        = array_keys( $data );
    35763693    $string_keys = array_filter( $keys, 'is_string' );
    35773694    return count( $string_keys ) === 0;
     
    37193836    global $submenu;
    37203837
    3721     if ( ! current_theme_supports( 'widgets' ) )
     3838    if ( ! current_theme_supports( 'widgets' ) ) {
    37223839        return;
     3840    }
    37233841
    37243842    $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' );
     
    37353853function wp_ob_end_flush_all() {
    37363854    $levels = ob_get_level();
    3737     for ($i=0; $i<$levels; $i++)
     3855    for ( $i = 0; $i < $levels; $i++ ) {
    37383856        ob_end_flush();
     3857    }
    37393858}
    37403859
     
    37693888
    37703889    // If installing or in the admin, provide the verbose message.
    3771     if ( wp_installing() || defined( 'WP_ADMIN' ) )
    3772         wp_die($wpdb->error);
     3890    if ( wp_installing() || defined( 'WP_ADMIN' ) ) {
     3891        wp_die( $wpdb->error );
     3892    }
    37733893
    37743894    // Otherwise, be terse.
     
    38513971            if ( ! is_null( $replacement ) ) {
    38523972                /* translators: 1: PHP function name, 2: version number, 3: alternative function name */
    3853                 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
     3973                trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $function, $version, $replacement ) );
    38543974            } else {
    38553975                /* translators: 1: PHP function name, 2: version number */
    3856                 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
     3976                trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $function, $version ) );
    38573977            }
    38583978        } else {
     
    39134033            if ( ! empty( $parent_class ) ) {
    39144034                /* translators: 1: PHP class name, 2: PHP parent class name, 3: version number, 4: __construct() method */
    3915                 trigger_error( sprintf( __( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
    3916                     $class, $parent_class, $version, '<pre>__construct()</pre>' ) );
     4035                trigger_error(
     4036                    sprintf(
     4037                        __( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
     4038                        $class, $parent_class, $version, '<pre>__construct()</pre>'
     4039                    )
     4040                );
    39174041            } else {
    39184042                /* translators: 1: PHP class name, 2: version number, 3: __construct() method */
    3919                 trigger_error( sprintf( __( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
    3920                     $class, $version, '<pre>__construct()</pre>' ) );
     4043                trigger_error(
     4044                    sprintf(
     4045                        __( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
     4046                        $class, $version, '<pre>__construct()</pre>'
     4047                    )
     4048                );
    39214049            }
    39224050        } else {
    39234051            if ( ! empty( $parent_class ) ) {
    3924                 trigger_error( sprintf( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.',
    3925                     $class, $parent_class, $version, '<pre>__construct()</pre>' ) );
     4052                trigger_error(
     4053                    sprintf(
     4054                        'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.',
     4055                        $class, $parent_class, $version, '<pre>__construct()</pre>'
     4056                    )
     4057                );
    39264058            } else {
    3927                 trigger_error( sprintf( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
    3928                     $class, $version, '<pre>__construct()</pre>' ) );
     4059                trigger_error(
     4060                    sprintf(
     4061                        'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
     4062                        $class, $version, '<pre>__construct()</pre>'
     4063                    )
     4064                );
    39294065            }
    39304066        }
     
    39794115            if ( ! is_null( $replacement ) ) {
    39804116                /* translators: 1: PHP file name, 2: version number, 3: alternative file name */
    3981                 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
     4117                trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $file, $version, $replacement ) . $message );
    39824118            } else {
    39834119                /* translators: 1: PHP file name, 2: version number */
    3984                 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message );
     4120                trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $file, $version ) . $message );
    39854121            }
    39864122        } else {
     
    40054141 *     }
    40064142 *
    4007  *
    40084143 * There is a hook deprecated_argument_run that will be called that can be used
    40094144 * to get the backtrace up to what file and function used the deprecated
     
    40434178            if ( ! is_null( $message ) ) {
    40444179                /* translators: 1: PHP function name, 2: version number, 3: optional message regarding the change */
    4045                 trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
     4180                trigger_error( sprintf( __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ), $function, $version, $message ) );
    40464181            } else {
    40474182                /* translators: 1: PHP function name, 2: version number */
    4048                 trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
     4183                trigger_error( sprintf( __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $function, $version ) );
    40494184            }
    40504185        } else {
     
    41554290            }
    41564291            /* translators: %s: Codex URL */
    4157             $message .= ' ' . sprintf( __( 'Please see <a href="%s">Debugging in WordPress</a> for more information.' ),
     4292            $message .= ' ' . sprintf(
     4293                __( 'Please see <a href="%s">Debugging in WordPress</a> for more information.' ),
    41584294                __( 'https://codex.wordpress.org/Debugging_in_WordPress' )
    41594295            );
     
    41664302                $version = sprintf( '(This message was added in version %s.)', $version );
    41674303            }
    4168             $message .= sprintf( ' Please see <a href="%s">Debugging in WordPress</a> for more information.',
     4304            $message .= sprintf(
     4305                ' Please see <a href="%s">Debugging in WordPress</a> for more information.',
    41694306                'https://codex.wordpress.org/Debugging_in_WordPress'
    41704307            );
     
    41824319 */
    41834320function is_lighttpd_before_150() {
    4184     $server_parts = explode( '/', isset( $_SERVER['SERVER_SOFTWARE'] )? $_SERVER['SERVER_SOFTWARE'] : '' );
    4185     $server_parts[1] = isset( $server_parts[1] )? $server_parts[1] : '';
     4321    $server_parts    = explode( '/', isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '' );
     4322    $server_parts[1] = isset( $server_parts[1] ) ? $server_parts[1] : '';
    41864323    return  'lighttpd' == $server_parts[0] && -1 == version_compare( $server_parts[1], '1.5.0' );
    41874324}
     
    41984335 * @return bool Whether the specified module is loaded.
    41994336 */
    4200 function apache_mod_loaded($mod, $default = false) {
     4337function apache_mod_loaded( $mod, $default = false ) {
    42014338    global $is_apache;
    42024339
    4203     if ( !$is_apache )
     4340    if ( ! $is_apache ) {
    42044341        return false;
     4342    }
    42054343
    42064344    if ( function_exists( 'apache_get_modules' ) ) {
    42074345        $mods = apache_get_modules();
    4208         if ( in_array($mod, $mods) )
     4346        if ( in_array( $mod, $mods ) ) {
    42094347            return true;
     4348        }
    42104349    } elseif ( function_exists( 'phpinfo' ) && false === strpos( ini_get( 'disable_functions' ), 'phpinfo' ) ) {
    42114350            ob_start();
    4212             phpinfo(8);
     4351            phpinfo( 8 );
    42134352            $phpinfo = ob_get_clean();
    4214             if ( false !== strpos($phpinfo, $mod) )
    4215                 return true;
     4353        if ( false !== strpos( $phpinfo, $mod ) ) {
     4354            return true;
     4355        }
    42164356    }
    42174357    return $default;
     
    42414381         * via ISAPI then pretty permalinks will not work.
    42424382         */
    4243         $supports_permalinks = class_exists( 'DOMDocument', false ) && isset($_SERVER['IIS_UrlRewriteModule']) && ( PHP_SAPI == 'cgi-fcgi' );
     4383        $supports_permalinks = class_exists( 'DOMDocument', false ) && isset( $_SERVER['IIS_UrlRewriteModule'] ) && ( PHP_SAPI == 'cgi-fcgi' );
    42444384    }
    42454385
     
    42864426
    42874427    // Files not in the allowed file list are not allowed:
    4288     if ( ! empty( $allowed_files ) && ! in_array( $file, $allowed_files ) )
     4428    if ( ! empty( $allowed_files ) && ! in_array( $file, $allowed_files ) ) {
    42894429        return 3;
     4430    }
    42904431
    42914432    // Absolute Windows drive paths are not allowed:
    4292     if (':' == substr( $file, 1, 1 ) )
     4433    if ( ':' == substr( $file, 1, 1 ) ) {
    42934434        return 2;
     4435    }
    42944436
    42954437    return 0;
     
    43094451    static $forced = false;
    43104452
    4311     if ( !is_null( $force ) ) {
     4453    if ( ! is_null( $force ) ) {
    43124454        $old_forced = $forced;
    4313         $forced = $force;
     4455        $forced     = $force;
    43144456        return $old_forced;
    43154457    }
     
    43294471 */
    43304472function wp_guess_url() {
    4331     if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
     4473    if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL ) {
    43324474        $url = WP_SITEURL;
    43334475    } else {
    4334         $abspath_fix = str_replace( '\\', '/', ABSPATH );
     4476        $abspath_fix         = str_replace( '\\', '/', ABSPATH );
    43354477        $script_filename_dir = dirname( $_SERVER['SCRIPT_FILENAME'] );
    43364478
     
    43394481            $path = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $_SERVER['REQUEST_URI'] );
    43404482
    4341         // The request is for a file in ABSPATH
     4483            // The request is for a file in ABSPATH
    43424484        } elseif ( $script_filename_dir . '/' == $abspath_fix ) {
    43434485            // Strip off any file/query params in the path
     
    43494491                $directory = str_replace( ABSPATH, '', $script_filename_dir );
    43504492                // Strip off the sub directory, and any file/query params
    4351                 $path = preg_replace( '#/' . preg_quote( $directory, '#' ) . '/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] );
     4493                $path = preg_replace( '#/' . preg_quote( $directory, '#' ) . '/[^/]*$#i', '', $_SERVER['REQUEST_URI'] );
    43524494            } elseif ( false !== strpos( $abspath_fix, $script_filename_dir ) ) {
    43534495                // Request is hitting a file above ABSPATH
    43544496                $subdirectory = substr( $abspath_fix, strpos( $abspath_fix, $script_filename_dir ) + strlen( $script_filename_dir ) );
    43554497                // Strip off any file/query params from the path, appending the sub directory to the installation
    4356                 $path = preg_replace( '#/[^/]*$#i', '' , $_SERVER['REQUEST_URI'] ) . $subdirectory;
     4498                $path = preg_replace( '#/[^/]*$#i', '', $_SERVER['REQUEST_URI'] ) . $subdirectory;
    43574499            } else {
    43584500                $path = $_SERVER['REQUEST_URI'];
     
    43614503
    43624504        $schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet
    4363         $url = $schema . $_SERVER['HTTP_HOST'] . $path;
    4364     }
    4365 
    4366     return rtrim($url, '/');
     4505        $url    = $schema . $_SERVER['HTTP_HOST'] . $path;
     4506    }
     4507
     4508    return rtrim( $url, '/' );
    43674509}
    43684510
     
    43874529    static $_suspend = false;
    43884530
    4389     if ( is_bool( $suspend ) )
     4531    if ( is_bool( $suspend ) ) {
    43904532        $_suspend = $suspend;
     4533    }
    43914534
    43924535    return $_suspend;
     
    44104553    global $_wp_suspend_cache_invalidation;
    44114554
    4412     $current_suspend = $_wp_suspend_cache_invalidation;
     4555    $current_suspend                = $_wp_suspend_cache_invalidation;
    44134556    $_wp_suspend_cache_invalidation = $suspend;
    44144557    return $current_suspend;
     
    45054648        $main_network_id = 1;
    45064649    } else {
    4507         $_networks = get_networks( array( 'fields' => 'ids', 'number' => 1 ) );
     4650        $_networks       = get_networks(
     4651            array(
     4652                'fields' => 'ids',
     4653                'number' => 1,
     4654            )
     4655        );
    45084656        $main_network_id = array_shift( $_networks );
    45094657    }
     
    45294677 */
    45304678function global_terms_enabled() {
    4531     if ( ! is_multisite() )
     4679    if ( ! is_multisite() ) {
    45324680        return false;
     4681    }
    45334682
    45344683    static $global_terms = null;
     
    45464695         */
    45474696        $filter = apply_filters( 'global_terms_enabled', null );
    4548         if ( ! is_null( $filter ) )
     4697        if ( ! is_null( $filter ) ) {
    45494698            $global_terms = (bool) $filter;
    4550         else
     4699        } else {
    45514700            $global_terms = (bool) get_site_option( 'global_terms_enabled', false );
     4701        }
    45524702    }
    45534703    return $global_terms;
     
    45644714 */
    45654715function wp_timezone_override_offset() {
    4566     if ( !$timezone_string = get_option( 'timezone_string' ) ) {
     4716    if ( ! $timezone_string = get_option( 'timezone_string' ) ) {
    45674717        return false;
    45684718    }
     
    46404790    static $mo_loaded = false, $locale_loaded = null;
    46414791
    4642     $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific');
     4792    $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' );
    46434793
    46444794    // Load translations for continents and cities.
    46454795    if ( ! $mo_loaded || $locale !== $locale_loaded ) {
    46464796        $locale_loaded = $locale ? $locale : get_locale();
    4647         $mofile = WP_LANG_DIR . '/continents-cities-' . $locale_loaded . '.mo';
     4797        $mofile        = WP_LANG_DIR . '/continents-cities-' . $locale_loaded . '.mo';
    46484798        unload_textdomain( 'continents-cities' );
    46494799        load_textdomain( 'continents-cities', $mofile );
     
    46544804    foreach ( timezone_identifiers_list() as $zone ) {
    46554805        $zone = explode( '/', $zone );
    4656         if ( !in_array( $zone[0], $continents ) ) {
     4806        if ( ! in_array( $zone[0], $continents ) ) {
    46574807            continue;
    46584808        }
    46594809
    46604810        // This determines what gets set and translated - we don't translate Etc/* strings here, they are done later
    4661         $exists = array(
     4811        $exists    = array(
    46624812            0 => ( isset( $zone[0] ) && $zone[0] ),
    46634813            1 => ( isset( $zone[1] ) && $zone[1] ),
     
    46744824            't_continent' => ( $exists[3] ? translate( str_replace( '_', ' ', $zone[0] ), 'continents-cities' ) : '' ),
    46754825            't_city'      => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ),
    4676             't_subcity'   => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' )
     4826            't_subcity'   => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ),
    46774827        );
    46784828    }
     
    46964846
    46974847            // Continent optgroup
    4698             if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) {
    4699                 $label = $zone['t_continent'];
    4700                 $structure[] = '<optgroup label="'. esc_attr( $label ) .'">';
     4848            if ( ! isset( $zonen[ $key - 1 ] ) || $zonen[ $key - 1 ]['continent'] !== $zone['continent'] ) {
     4849                $label       = $zone['t_continent'];
     4850                $structure[] = '<optgroup label="' . esc_attr( $label ) . '">';
    47014851            }
    47024852
     
    47054855
    47064856            $display = $zone['t_city'];
    4707             if ( !empty( $zone['subcity'] ) ) {
     4857            if ( ! empty( $zone['subcity'] ) ) {
    47084858                // Add the subcity to the value
    4709                 $value[] = $zone['subcity'];
     4859                $value[]  = $zone['subcity'];
    47104860                $display .= ' - ' . $zone['t_subcity'];
    47114861            }
     
    47134863
    47144864        // Build the value
    4715         $value = join( '/', $value );
     4865        $value    = join( '/', $value );
    47164866        $selected = '';
    47174867        if ( $value === $selected_zone ) {
    47184868            $selected = 'selected="selected" ';
    47194869        }
    4720         $structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>";
     4870        $structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . '</option>';
    47214871
    47224872        // Close continent optgroup
    4723         if ( !empty( $zone['city'] ) && ( !isset($zonen[$key + 1]) || (isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) ) ) {
     4873        if ( ! empty( $zone['city'] ) && ( ! isset( $zonen[ $key + 1 ] ) || ( isset( $zonen[ $key + 1 ] ) && $zonen[ $key + 1 ]['continent'] !== $zone['continent'] ) ) ) {
    47244874            $structure[] = '</optgroup>';
    47254875        }
     
    47274877
    47284878    // Do UTC
    4729     $structure[] = '<optgroup label="'. esc_attr__( 'UTC' ) .'">';
    4730     $selected = '';
    4731     if ( 'UTC' === $selected_zone )
     4879    $structure[] = '<optgroup label="' . esc_attr__( 'UTC' ) . '">';
     4880    $selected    = '';
     4881    if ( 'UTC' === $selected_zone ) {
    47324882        $selected = 'selected="selected" ';
    4733     $structure[] = '<option ' . $selected . 'value="' . esc_attr( 'UTC' ) . '">' . __('UTC') . '</option>';
     4883    }
     4884    $structure[] = '<option ' . $selected . 'value="' . esc_attr( 'UTC' ) . '">' . __( 'UTC' ) . '</option>';
    47344885    $structure[] = '</optgroup>';
    47354886
    47364887    // Do manual UTC offsets
    4737     $structure[] = '<optgroup label="'. esc_attr__( 'Manual Offsets' ) .'">';
    4738     $offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
    4739         0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14);
     4888    $structure[]  = '<optgroup label="' . esc_attr__( 'Manual Offsets' ) . '">';
     4889    $offset_range = array(
     4890        -12,
     4891        -11.5,
     4892        -11,
     4893        -10.5,
     4894        -10,
     4895        -9.5,
     4896        -9,
     4897        -8.5,
     4898        -8,
     4899        -7.5,
     4900        -7,
     4901        -6.5,
     4902        -6,
     4903        -5.5,
     4904        -5,
     4905        -4.5,
     4906        -4,
     4907        -3.5,
     4908        -3,
     4909        -2.5,
     4910        -2,
     4911        -1.5,
     4912        -1,
     4913        -0.5,
     4914        0,
     4915        0.5,
     4916        1,
     4917        1.5,
     4918        2,
     4919        2.5,
     4920        3,
     4921        3.5,
     4922        4,
     4923        4.5,
     4924        5,
     4925        5.5,
     4926        5.75,
     4927        6,
     4928        6.5,
     4929        7,
     4930        7.5,
     4931        8,
     4932        8.5,
     4933        8.75,
     4934        9,
     4935        9.5,
     4936        10,
     4937        10.5,
     4938        11,
     4939        11.5,
     4940        12,
     4941        12.75,
     4942        13,
     4943        13.75,
     4944        14,
     4945    );
    47404946    foreach ( $offset_range as $offset ) {
    4741         if ( 0 <= $offset )
     4947        if ( 0 <= $offset ) {
    47424948            $offset_name = '+' . $offset;
    4743         else
     4949        } else {
    47444950            $offset_name = (string) $offset;
     4951        }
    47454952
    47464953        $offset_value = $offset_name;
    4747         $offset_name = str_replace(array('.25','.5','.75'), array(':15',':30',':45'), $offset_name);
    4748         $offset_name = 'UTC' . $offset_name;
     4954        $offset_name  = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $offset_name );
     4955        $offset_name  = 'UTC' . $offset_name;
    47494956        $offset_value = 'UTC' . $offset_value;
    4750         $selected = '';
    4751         if ( $offset_value === $selected_zone )
     4957        $selected     = '';
     4958        if ( $offset_value === $selected_zone ) {
    47524959            $selected = 'selected="selected" ';
    4753         $structure[] = '<option ' . $selected . 'value="' . esc_attr( $offset_value ) . '">' . esc_html( $offset_name ) . "</option>";
     4960        }
     4961        $structure[] = '<option ' . $selected . 'value="' . esc_attr( $offset_value ) . '">' . esc_html( $offset_name ) . '</option>';
    47544962
    47554963    }
     
    47714979 */
    47724980function _cleanup_header_comment( $str ) {
    4773     return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str));
     4981    return trim( preg_replace( '/\s*(?:\*\/|\?>).*/', '', $str ) );
    47744982}
    47754983
     
    47894997    $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );
    47904998
    4791     $posts_to_delete = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < %d", $delete_timestamp), ARRAY_A);
     4999    $posts_to_delete = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < %d", $delete_timestamp ), ARRAY_A );
    47925000
    47935001    foreach ( (array) $posts_to_delete as $post ) {
    47945002        $post_id = (int) $post['post_id'];
    4795         if ( !$post_id )
     5003        if ( ! $post_id ) {
    47965004            continue;
    4797 
    4798         $del_post = get_post($post_id);
    4799 
    4800         if ( !$del_post || 'trash' != $del_post->post_status ) {
    4801             delete_post_meta($post_id, '_wp_trash_meta_status');
    4802             delete_post_meta($post_id, '_wp_trash_meta_time');
     5005        }
     5006
     5007        $del_post = get_post( $post_id );
     5008
     5009        if ( ! $del_post || 'trash' != $del_post->post_status ) {
     5010            delete_post_meta( $post_id, '_wp_trash_meta_status' );
     5011            delete_post_meta( $post_id, '_wp_trash_meta_time' );
    48035012        } else {
    4804             wp_delete_post($post_id);
    4805         }
    4806     }
    4807 
    4808     $comments_to_delete = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < %d", $delete_timestamp), ARRAY_A);
     5013            wp_delete_post( $post_id );
     5014        }
     5015    }
     5016
     5017    $comments_to_delete = $wpdb->get_results( $wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < %d", $delete_timestamp ), ARRAY_A );
    48095018
    48105019    foreach ( (array) $comments_to_delete as $comment ) {
    48115020        $comment_id = (int) $comment['comment_id'];
    4812         if ( !$comment_id )
     5021        if ( ! $comment_id ) {
    48135022            continue;
    4814 
    4815         $del_comment = get_comment($comment_id);
    4816 
    4817         if ( !$del_comment || 'trash' != $del_comment->comment_approved ) {
    4818             delete_comment_meta($comment_id, '_wp_trash_meta_time');
    4819             delete_comment_meta($comment_id, '_wp_trash_meta_status');
     5023        }
     5024
     5025        $del_comment = get_comment( $comment_id );
     5026
     5027        if ( ! $del_comment || 'trash' != $del_comment->comment_approved ) {
     5028            delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
     5029            delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
    48205030        } else {
    48215031            wp_delete_comment( $del_comment );
     
    48695079    if ( $context && $extra_headers = apply_filters( "extra_{$context}_headers", array() ) ) {
    48705080        $extra_headers = array_combine( $extra_headers, $extra_headers ); // keys equal values
    4871         $all_headers = array_merge( $extra_headers, (array) $default_headers );
     5081        $all_headers   = array_merge( $extra_headers, (array) $default_headers );
    48725082    } else {
    48735083        $all_headers = $default_headers;
     
    48755085
    48765086    foreach ( $all_headers as $field => $regex ) {
    4877         if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] )
     5087        if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) {
    48785088            $all_headers[ $field ] = _cleanup_header_comment( $match[1] );
    4879         else
     5089        } else {
    48805090            $all_headers[ $field ] = '';
     5091        }
    48815092    }
    48825093
     
    49915202function _wp_mysql_week( $column ) {
    49925203    switch ( $start_of_week = (int) get_option( 'start_of_week' ) ) {
    4993     case 1 :
    4994         return "WEEK( $column, 1 )";
    4995     case 2 :
    4996     case 3 :
    4997     case 4 :
    4998     case 5 :
    4999     case 6 :
    5000         return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )";
    5001     case 0 :
    5002     default :
    5003         return "WEEK( $column, 0 )";
     5204        case 1:
     5205            return "WEEK( $column, 1 )";
     5206        case 2:
     5207        case 3:
     5208        case 4:
     5209        case 5:
     5210        case 6:
     5211            return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )";
     5212        case 0:
     5213        default:
     5214            return "WEEK( $column, 0 )";
    50045215    }
    50055216}
     
    50215232    $override = is_null( $start_parent ) ? array() : array( $start => $start_parent );
    50225233
    5023     if ( !$arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args ) )
     5234    if ( ! $arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args ) ) {
    50245235        return array();
     5236    }
    50255237
    50265238    return wp_find_hierarchy_loop_tortoise_hare( $callback, $arbitrary_loop_member, $override, $callback_args, true );
     
    50495261function wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = array(), $callback_args = array(), $_return_loop = false ) {
    50505262    $tortoise = $hare = $evanescent_hare = $start;
    5051     $return = array();
     5263    $return   = array();
    50525264
    50535265    // Set evanescent_hare to one past hare
     
    50565268        $tortoise
    50575269    &&
    5058         ( $evanescent_hare = isset( $override[$hare] ) ? $override[$hare] : call_user_func_array( $callback, array_merge( array( $hare ), $callback_args ) ) )
     5270        ( $evanescent_hare = isset( $override[ $hare ] ) ? $override[ $hare ] : call_user_func_array( $callback, array_merge( array( $hare ), $callback_args ) ) )
    50595271    &&
    5060         ( $hare = isset( $override[$evanescent_hare] ) ? $override[$evanescent_hare] : call_user_func_array( $callback, array_merge( array( $evanescent_hare ), $callback_args ) ) )
     5272        ( $hare = isset( $override[ $evanescent_hare ] ) ? $override[ $evanescent_hare ] : call_user_func_array( $callback, array_merge( array( $evanescent_hare ), $callback_args ) ) )
    50615273    ) {
    5062         if ( $_return_loop )
    5063             $return[$tortoise] = $return[$evanescent_hare] = $return[$hare] = true;
     5274        if ( $_return_loop ) {
     5275            $return[ $tortoise ] = $return[ $evanescent_hare ] = $return[ $hare ] = true;
     5276        }
    50645277
    50655278        // tortoise got lapped - must be a loop
    5066         if ( $tortoise == $evanescent_hare || $tortoise == $hare )
     5279        if ( $tortoise == $evanescent_hare || $tortoise == $hare ) {
    50675280            return $_return_loop ? $return : $tortoise;
     5281        }
    50685282
    50695283        // Increment tortoise by one step
    5070         $tortoise = isset( $override[$tortoise] ) ? $override[$tortoise] : call_user_func_array( $callback, array_merge( array( $tortoise ), $callback_args ) );
     5284        $tortoise = isset( $override[ $tortoise ] ) ? $override[ $tortoise ] : call_user_func_array( $callback, array_merge( array( $tortoise ), $callback_args ) );
    50715285    }
    50725286
     
    51405354 */
    51415355function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
    5142     if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) )
     5356    if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) ) {
    51435357        $trace = debug_backtrace( false );
    5144     else
     5358    } else {
    51455359        $trace = debug_backtrace();
    5146 
    5147     $caller = array();
     5360    }
     5361
     5362    $caller      = array();
    51485363    $check_class = ! is_null( $ignore_class );
    51495364    $skip_frames++; // skip this function
     
    51535368            $skip_frames--;
    51545369        } elseif ( isset( $call['class'] ) ) {
    5155             if ( $check_class && $ignore_class == $call['class'] )
     5370            if ( $check_class && $ignore_class == $call['class'] ) {
    51565371                continue; // Filter out calls
     5372            }
    51575373
    51585374            $caller[] = "{$call['class']}{$call['type']}{$call['function']}";
     
    51615377                $caller[] = "{$call['function']}('{$call['args'][0]}')";
    51625378            } elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) ) {
    5163                 $caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ) , '', $call['args'][0] ) . "')";
     5379                $caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ), '', $call['args'][0] ) . "')";
    51645380            } else {
    51655381                $caller[] = $call['function'];
     
    51675383        }
    51685384    }
    5169     if ( $pretty )
     5385    if ( $pretty ) {
    51705386        return join( ', ', array_reverse( $caller ) );
    5171     else
     5387    } else {
    51725388        return $caller;
     5389    }
    51735390}
    51745391
     
    51885405    foreach ( $object_ids as $id ) {
    51895406        $id = (int) $id;
    5190         if ( !wp_cache_get( $id, $cache_key ) ) {
     5407        if ( ! wp_cache_get( $id, $cache_key ) ) {
    51915408            $clean[] = $id;
    51925409        }
     
    52055422 */
    52065423function _device_can_upload() {
    5207     if ( ! wp_is_mobile() )
     5424    if ( ! wp_is_mobile() ) {
    52085425        return true;
     5426    }
    52095427
    52105428    $ua = $_SERVER['HTTP_USER_AGENT'];
    52115429
    5212     if ( strpos($ua, 'iPhone') !== false
    5213         || strpos($ua, 'iPad') !== false
    5214         || strpos($ua, 'iPod') !== false ) {
     5430    if ( strpos( $ua, 'iPhone' ) !== false
     5431        || strpos( $ua, 'iPad' ) !== false
     5432        || strpos( $ua, 'iPod' ) !== false ) {
    52155433            return preg_match( '#OS ([\d_]+) like Mac OS X#', $ua, $version ) && version_compare( $version[1], '6', '>=' );
    52165434    }
     
    52285446 */
    52295447function wp_is_stream( $path ) {
    5230     $wrappers = stream_get_wrappers();
    5231     $wrappers_re = '(' . join('|', $wrappers) . ')';
     5448    $wrappers    = stream_get_wrappers();
     5449    $wrappers_re = '(' . join( '|', $wrappers ) . ')';
    52325450
    52335451    return preg_match( "!^$wrappers_re://!", $path ) === 1;
     
    52715489 */
    52725490function wp_auth_check_load() {
    5273     if ( ! is_admin() && ! is_user_logged_in() )
     5491    if ( ! is_admin() && ! is_user_logged_in() ) {
    52745492        return;
    5275 
    5276     if ( defined( 'IFRAME_REQUEST' ) )
     5493    }
     5494
     5495    if ( defined( 'IFRAME_REQUEST' ) ) {
    52775496        return;
     5497    }
    52785498
    52795499    $screen = get_current_screen();
    52805500    $hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' );
    5281     $show = ! in_array( $screen->id, $hidden );
     5501    $show   = ! in_array( $screen->id, $hidden );
    52825502
    52835503    /**
     
    53075527 */
    53085528function wp_auth_check_html() {
    5309     $login_url = wp_login_url();
     5529    $login_url      = wp_login_url();
    53105530    $current_domain = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'];
    5311     $same_domain = ( strpos( $login_url, $current_domain ) === 0 );
     5531    $same_domain    = ( strpos( $login_url, $current_domain ) === 0 );
    53125532
    53135533    /**
     
    53195539     */
    53205540    $same_domain = apply_filters( 'wp_auth_check_same_domain', $same_domain );
    5321     $wrap_class = $same_domain ? 'hidden' : 'hidden fallback';
     5541    $wrap_class  = $same_domain ? 'hidden' : 'hidden fallback';
    53225542
    53235543    ?>
     
    53295549
    53305550    if ( $same_domain ) {
    5331         $login_src = add_query_arg( array(
    5332             'interim-login' => '1',
    5333             'wp_lang'       => get_user_locale(),
    5334         ), $login_url );
     5551        $login_src = add_query_arg(
     5552            array(
     5553                'interim-login' => '1',
     5554                'wp_lang'       => get_user_locale(),
     5555            ), $login_url
     5556        );
    53355557        ?>
    53365558        <div id="wp-auth-check-form" class="loading" data-src="<?php echo esc_url( $login_src ); ?>"></div>
     
    53405562    ?>
    53415563    <div class="wp-auth-fallback">
    5342         <p><b class="wp-auth-fallback-expired" tabindex="0"><?php _e('Session expired'); ?></b></p>
    5343         <p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e('Please log in again.'); ?></a>
    5344         <?php _e('The login page will open in a new window. After logging in you can close it and return to this page.'); ?></p>
     5564        <p><b class="wp-auth-fallback-expired" tabindex="0"><?php _e( 'Session expired' ); ?></b></p>
     5565        <p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e( 'Please log in again.' ); ?></a>
     5566        <?php _e( 'The login page will open in a new window. After logging in you can close it and return to this page.' ); ?></p>
    53455567    </div>
    53465568    </div>
     
    53845606 */
    53855607function get_tag_regex( $tag ) {
    5386     if ( empty( $tag ) )
     5608    if ( empty( $tag ) ) {
    53875609        return;
     5610    }
    53885611    return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) );
    53895612}
     
    54025625 */
    54035626function _canonical_charset( $charset ) {
    5404     if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset) ) {
     5627    if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset ) ) {
    54055628
    54065629        return 'UTF-8';
     
    54425665 */
    54435666function mbstring_binary_safe_encoding( $reset = false ) {
    5444     static $encodings = array();
     5667    static $encodings  = array();
    54455668    static $overloaded = null;
    54465669
    5447     if ( is_null( $overloaded ) )
     5670    if ( is_null( $overloaded ) ) {
    54485671        $overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 );
    5449 
    5450     if ( false === $overloaded )
     5672    }
     5673
     5674    if ( false === $overloaded ) {
    54515675        return;
     5676    }
    54525677
    54535678    if ( ! $reset ) {
     
    56865911 */
    56875912function wp_generate_uuid4() {
    5688     return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
     5913    return sprintf(
     5914        '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
    56895915        mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
    56905916        mt_rand( 0, 0xffff ),
     
    57695995
    57705996    /* translators: Do not translate OLD_EMAIL, NEW_EMAIL, SITENAME, SITEURL: those are placeholders. */
    5771     $email_change_text = __( 'Hi,
     5997    $email_change_text = __(
     5998        'Hi,
    57725999
    57736000This notice confirms that the admin email address was changed on ###SITENAME###.
     
    57796006Regards,
    57806007All at ###SITENAME###
    5781 ###SITEURL###' );
     6008###SITEURL###'
     6009    );
    57826010
    57836011    $email_change_email = array(
     
    58166044    $email_change_email['message'] = str_replace( '###OLD_EMAIL###', $old_email, $email_change_email['message'] );
    58176045    $email_change_email['message'] = str_replace( '###NEW_EMAIL###', $new_email, $email_change_email['message'] );
    5818     $email_change_email['message'] = str_replace( '###SITENAME###',  $site_name, $email_change_email['message'] );
    5819     $email_change_email['message'] = str_replace( '###SITEURL###',   home_url(), $email_change_email['message'] );
    5820 
    5821     wp_mail( $email_change_email['to'], sprintf(
    5822         $email_change_email['subject'],
    5823         $site_name
    5824     ), $email_change_email['message'], $email_change_email['headers'] );
    5825 }
     6046    $email_change_email['message'] = str_replace( '###SITENAME###', $site_name, $email_change_email['message'] );
     6047    $email_change_email['message'] = str_replace( '###SITEURL###', home_url(), $email_change_email['message'] );
     6048
     6049    wp_mail(
     6050        $email_change_email['to'], sprintf(
     6051            $email_change_email['subject'],
     6052            $site_name
     6053        ), $email_change_email['message'], $email_change_email['headers']
     6054    );
     6055}
Note: See TracChangeset for help on using the changeset viewer.