WordPress.org

Make WordPress Core

Ticket #16325: garyc40.16325.diff

File garyc40.16325.diff, 5.7 KB (added by garyc40, 7 years ago)

fix deprecated split() in other files

  • wp-admin/network/edit.php

    diff --git wp-admin/network/edit.php wp-admin/network/edit.php
    index 1e06e49..1025eaa 100644
    switch ( $_GET['action'] ) { 
    110110                if ( is_email( $_POST['admin_email'] ) )
    111111                        update_site_option( 'admin_email', $_POST['admin_email'] );
    112112
    113                 $illegal_names = split( ' ', $_POST['illegal_names'] );
     113                $illegal_names = explode( ' ', $_POST['illegal_names'] );
    114114                foreach ( (array) $illegal_names as $name ) {
    115115                        $name = trim( $name );
    116116                        if ( $name != '' )
    switch ( $_GET['action'] ) { 
    120120
    121121                if ( $_POST['limited_email_domains'] != '' ) {
    122122                        $limited_email_domains = str_replace( ' ', "\n", $_POST['limited_email_domains'] );
    123                         $limited_email_domains = split( "\n", stripslashes( $limited_email_domains ) );
     123                        $limited_email_domains = explode( "\n", stripslashes( $limited_email_domains ) );
    124124                        $limited_email = array();
    125125                        foreach ( (array) $limited_email_domains as $domain ) {
    126126                                        $domain = trim( $domain );
    switch ( $_GET['action'] ) { 
    133133                }
    134134
    135135                if ( $_POST['banned_email_domains'] != '' ) {
    136                         $banned_email_domains = split( "\n", stripslashes( $_POST['banned_email_domains'] ) );
     136                        $banned_email_domains = explode( "\n", stripslashes( $_POST['banned_email_domains'] ) );
    137137                        $banned = array();
    138138                        foreach ( (array) $banned_email_domains as $domain ) {
    139139                                $domain = trim( $domain );
  • wp-admin/press-this.php

    diff --git wp-admin/press-this.php wp-admin/press-this.php
    index aa4eb47..3e5e1de 100644
    var photostorage = false; 
    381381                                        <?php
    382382                                        $content = '';
    383383                                        if ( preg_match("/youtube\.com\/watch/i", $url) ) {
    384                                                 list($domain, $video_id) = split("v=", $url);
     384                                                list($domain, $video_id) = explode("v=", $url);
    385385                                                $video_id = esc_attr($video_id);
    386386                                                $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
    387387
    388388                                        } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) {
    389                                                 list($domain, $video_id) = split(".com/", $url);
     389                                                list($domain, $video_id) = explode(".com/", $url);
    390390                                                $video_id = esc_attr($video_id);
    391391                                                $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" />      <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>';
    392392
  • wp-includes/class-wp-xmlrpc-server.php

    diff --git wp-includes/class-wp-xmlrpc-server.php wp-includes/class-wp-xmlrpc-server.php
    index 5e9bbd4..40c5b38 100644
    class wp_xmlrpc_server extends IXR_Server { 
    27352735                        foreach ( (array) get_post_custom($post_ID) as $key => $val) {
    27362736                                if ($key == 'enclosure') {
    27372737                                        foreach ( (array) $val as $enc ) {
    2738                                                 $encdata = split("\n", $enc);
     2738                                                $encdata = explode("\n", $enc);
    27392739                                                $enclosure['url'] = trim(htmlspecialchars($encdata[0]));
    27402740                                                $enclosure['length'] = (int) trim($encdata[1]);
    27412741                                                $enclosure['type'] = trim($encdata[2]);
  • wp-includes/feed.php

    diff --git wp-includes/feed.php wp-includes/feed.php
    index b94e347..ec68221 100644
    function atom_enclosure() { 
    423423        foreach ( (array) get_post_custom() as $key => $val ) {
    424424                if ($key == 'enclosure') {
    425425                        foreach ( (array) $val as $enc ) {
    426                                 $enclosure = split("\n", $enc);
     426                                $enclosure = explode("\n", $enc);
    427427                                echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
    428428                        }
    429429                }
  • wp-includes/kses.php

    diff --git wp-includes/kses.php wp-includes/kses.php
    index aea7aa8..afdea53 100644
    function safecss_filter_attr( $css, $deprecated = '' ) { 
    14041404                if ( strpos( $css_item, ':' ) === false ) {
    14051405                        $found = true;
    14061406                } else {
    1407                         $parts = split( ':', $css_item );
     1407                        $parts = explode( ':', $css_item );
    14081408                        if ( in_array( trim( $parts[0] ), $allowed_attr ) )
    14091409                                $found = true;
    14101410                }
  • wp-includes/pluggable.php

    diff --git wp-includes/pluggable.php wp-includes/pluggable.php
    index 4082340..a8d8a7b 100644
    function wp_text_diff( $left_string, $right_string, $args = null ) { 
    17401740        $left_string  = normalize_whitespace($left_string);
    17411741        $right_string = normalize_whitespace($right_string);
    17421742
    1743         $left_lines  = split("\n", $left_string);
    1744         $right_lines = split("\n", $right_string);
     1743        $left_lines  = explode("\n", $left_string);
     1744        $right_lines = explode("\n", $right_string);
    17451745
    17461746        $text_diff = new Text_Diff($left_lines, $right_lines);
    17471747        $renderer  = new WP_Text_Diff_Renderer_Table();
  • wp-includes/post.php

    diff --git wp-includes/post.php wp-includes/post.php
    index 3c3759e..e5dd986 100644
    function get_enclosed($post_id) { 
    29962996                if ( 'enclosure' != $key || !is_array( $val ) )
    29972997                        continue;
    29982998                foreach( $val as $enc ) {
    2999                         $enclosure = split( "\n", $enc );
     2999                        $enclosure = explode( "\n", $enc );
    30003000                        $pung[] = trim( $enclosure[ 0 ] );
    30013001                }
    30023002        }