Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-admin/admin-functions.php

    r4760 r5453  
    2323
    2424    // Check for autosave collisions
     25    $temp_id = false;
    2526    if ( isset($_POST['temp_ID']) ) {
    2627        $temp_id = (int) $_POST['temp_ID'];
     
    3435            $_POST['post_ID'] = $draft_ids[$temp_id];
    3536            unset($_POST['temp_ID']);
    36             relocate_children( $temp_id, $_POST['post_ID'] );
    3737            update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids );
    3838            return edit_post();
     
    113113
    114114    // Reunite any orphaned attachments with their parent
     115    if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
     116        $draft_ids = array();
     117    if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) )
     118        relocate_children( $draft_temp_id, $post_ID );
     119    if ( $temp_id && $temp_id != $draft_temp_id )
     120        relocate_children( $temp_id, $post_ID );
     121
    115122    // Update autosave collision detection
    116123    if ( $temp_id ) {
    117         relocate_children( $temp_id, $post_ID );
    118124        $draft_ids[$temp_id] = $post_ID;
    119125        update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids );
     
    140146    $post = & get_post( $post_ID, ARRAY_A );
    141147
    142     $search = "#<a[^>]+rel=('|\" )[^'\"]*attachment[^>]*>#ie";
     148    $search = "#<a[^>]+rel=('|\")[^'\"]*attachment[^>]*>#ie";
    143149
    144150    // See if we have any rel="attachment" links
     
    147153
    148154    $i = 0;
    149     $search = "#[\s]+rel=(\"|' )(.*? )wp-att-(\d+ )\\1#i";
     155    $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i";
    150156    foreach ( $anchor_matches[0] as $anchor ) {
    151157        if ( 0 == preg_match( $search, $anchor, $id_matches ) )
    152158            continue;
    153159
    154         $id = $id_matches[3];
     160        $id = (int) $id_matches[3];
    155161
    156162        // While we have the attachment ID, let's adopt any orphans.
     
    280286    add_meta( $post_ID );
    281287
    282     wp_update_post( $_POST);
     288    wp_update_post( $_POST );
     289
     290    // Reunite any orphaned attachments with their parent
     291    if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
     292        $draft_ids = array();
     293    if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) )
     294        relocate_children( $draft_temp_id, $post_ID );
    283295
    284296    // Now that we have an ID we can fix any attachment anchor hrefs
     
    359371        $text       = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) );
    360372        $text       = funky_javascript_fix( $text);
    361         $popupurl   = attribute_escape($_REQUEST['popupurl']);
     373        $popupurl   = clean_url($_REQUEST['popupurl']);
    362374        $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";
    363375    }
     
    418430    $user->user_login   = attribute_escape($user->user_login);
    419431    $user->user_email   = attribute_escape($user->user_email);
    420     $user->user_url     = attribute_escape($user->user_url);
     432    $user->user_url     = clean_url($user->user_url);
    421433    $user->first_name   = attribute_escape($user->first_name);
    422434    $user->last_name    = attribute_escape($user->last_name);
     
    436448    if ( func_num_args() ) { // The hackiest hack that ever did hack
    437449        global $current_user, $wp_roles;
    438         $user_id = func_get_arg( 0 );
     450        $user_id = (int) func_get_arg( 0 );
    439451
    440452        if ( isset( $_POST['role'] ) ) {
     
    454466    if ( $user_id != 0 ) {
    455467        $update = true;
    456         $user->ID = $user_id;
     468        $user->ID = (int) $user_id;
    457469        $userdata = get_userdata( $user_id );
    458470        $user->user_login = $wpdb->escape( $userdata->user_login );
     
    479491        $user->user_email = wp_specialchars( trim( $_POST['email'] ));
    480492    if ( isset( $_POST['url'] ) ) {
    481         $user->user_url = wp_specialchars( trim( $_POST['url'] ));
     493        $user->user_url = clean_url( trim( $_POST['url'] ));
    482494        $user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
    483495    }
     
    563575    $link = get_link( $link_id );
    564576
    565     $link->link_url         = attribute_escape($link->link_url);
     577    $link->link_url         = clean_url($link->link_url);
    566578    $link->link_name        = attribute_escape($link->link_name);
    567579    $link->link_image       = attribute_escape($link->link_image);
    568580    $link->link_description = attribute_escape($link->link_description);
    569     $link->link_rss         = attribute_escape($link->link_rss);
     581    $link->link_rss         = clean_url($link->link_rss);
    570582    $link->link_rel         = attribute_escape($link->link_rel);
    571583    $link->link_notes       =  wp_specialchars($link->link_notes);
     
    577589function get_default_link_to_edit() {
    578590    if ( isset( $_GET['linkurl'] ) )
    579         $link->link_url = attribute_escape( $_GET['linkurl']);
     591        $link->link_url = clean_url( $_GET['linkurl']);
    580592    else
    581593        $link->link_url = '';
     
    600612
    601613    $_POST['link_url'] = wp_specialchars( $_POST['link_url'] );
    602     $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url'];
     614    $_POST['link_url'] = clean_url($_POST['link_url']);
    603615    $_POST['link_name'] = wp_specialchars( $_POST['link_name'] );
    604616    $_POST['link_image'] = wp_specialchars( $_POST['link_image'] );
    605     $_POST['link_rss'] = wp_specialchars( $_POST['link_rss'] );
     617    $_POST['link_rss'] = clean_url($_POST['link_rss']);
    606618    $_POST['link_category'] = $_POST['post_category'];
    607619
     
    670682            // No selected categories, strange
    671683            $checked_categories[] = $default;
    672         }   
     684        }
    673685    } else {
    674686        $checked_categories[] = $default;
     
    694706function write_nested_categories( $categories ) {
    695707    foreach ( $categories as $category ) {
    696         echo '<li id="category-', $category['cat_ID'], '"><label for="in-category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="in-category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : "" ), '/> ', wp_specialchars( $category['cat_name'] ), "</label></li>";
     708        echo '<li id="category-', $category['cat_ID'], '"><label for="in-category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="in-category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : "" ), '/> ', wp_specialchars( apply_filters('the_category', $category['cat_name'] )), "</label></li>";
    697709
    698710        if ( $category['children'] ) {
     
    726738            // No selected categories, strange
    727739            $checked_categories[] = $default;
    728         }   
     740        }
    729741    } else {
    730742        $checked_categories[] = $default;
     
    757769        $categories = get_categories( 'hide_empty=0' );
    758770
     771    $children = _get_category_hierarchy();
     772
    759773    if ( $categories ) {
    760774        ob_start();
     
    762776            if ( $category->category_parent == $parent) {
    763777                echo "\t" . _cat_row( $category, $level );
    764                 cat_rows( $category->cat_ID, $level +1, $categories );
     778                if ( isset($children[$category->cat_ID]) )
     779                    cat_rows( $category->cat_ID, $level +1, $categories );
    765780            }
    766781        }
    767782        $output = ob_get_contents();
    768783        ob_end_clean();
    769        
     784
    770785        $output = apply_filters('cat_rows', $output);
    771786
     
    782797    if ( current_user_can( 'manage_categories' ) ) {
    783798        $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__( 'Edit' )."</a></td>";
    784         $default_cat_id = get_option( 'default_category' );
    785         $default_link_cat_id = get_option( 'default_link_category' );
     799        $default_cat_id = (int) get_option( 'default_category' );
     800        $default_link_cat_id = (int) get_option( 'default_link_category' );
    786801
    787802        if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) )
    788             $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll of its posts will go into the default category of '%s'\nAll of its bookmarks will go into the default category of '%s'.\n'OK' to delete, 'Cancel' to stop." ), $category->cat_name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>";
     803            $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll posts that were only assigned to this category will be assigned to the '%s' category.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop." ), $category->cat_name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>";
    789804        else
    790805            $edit .= "<td style='text-align:center'>".__( "Default" );
     
    822837        $post->post_title = wp_specialchars( $post->post_title );
    823838        $pad = str_repeat( '&#8212; ', $level );
    824         $id = $post->ID;
     839        $id = (int) $post->ID;
    825840        $class = ('alternate' == $class ) ? '' : 'alternate';
    826841?>
     
    831846    </td>
    832847    <td><?php the_author() ?></td>
    833     <td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Unpublished'); else echo mysql2date( 'Y-m-d g:i a', $post->post_modified ); ?></td>
     848    <td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Unpublished'); else echo mysql2date( __('Y-m-d g:i a'), $post->post_modified ); ?></td>
    834849    <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e( 'View' ); ?></a></td>
    835850    <td><?php if ( current_user_can( 'edit_page', $id ) ) { echo "<a href='page.php?action=edit&amp;post=$id' class='edit'>" . __( 'Edit' ) . "</a>"; } ?></td>
     
    868883    $r .= "</td>\n\t\t<td>";
    869884    if ( current_user_can( 'edit_user', $user_object->ID ) ) {
    870         $edit_link = attribute_escape( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ));
     885        $edit_link = add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" );
    871886        $r .= "<a href='$edit_link' class='edit'>".__( 'Edit' )."</a>";
    872887    }
    873888    $r .= "</td>\n\t</tr>";
    874889    return $r;
     890}
     891
     892function _wp_get_comment_list( $s = false, $start, $num ) {
     893    global $wpdb;
     894
     895    $start = (int) $start;
     896    $num = (int) $num;
     897
     898    if ( $s ) {
     899        $s = $wpdb->escape($s);
     900        $comments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE
     901            (comment_author LIKE '%$s%' OR
     902            comment_author_email LIKE '%$s%' OR
     903            comment_author_url LIKE ('%$s%') OR
     904            comment_author_IP LIKE ('%$s%') OR
     905            comment_content LIKE ('%$s%') ) AND
     906            comment_approved != 'spam'
     907            ORDER BY comment_date DESC LIMIT $start, $num");
     908    } else {
     909        $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE comment_approved = '0' OR comment_approved = '1' ORDER BY comment_date DESC LIMIT $start, $num" );
     910    }
     911
     912    $total = $wpdb->get_var( "SELECT FOUND_ROWS()" );
     913
     914    return array($comments, $total);
     915}
     916
     917function _wp_comment_list_item( $id, $alt = 0 ) {
     918    global $authordata, $comment, $wpdb;
     919    $id = (int) $id;
     920    $comment =& get_comment( $id );
     921    $class = '';
     922    $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
     923    $comment_status = wp_get_comment_status($comment->comment_ID);
     924    if ( 'unapproved' == $comment_status )
     925        $class .= ' unapproved';
     926    if ( $alt % 2 )
     927        $class .= ' alternate';
     928    echo "<li id='comment-$comment->comment_ID' class='$class'>";
     929?>
     930<p><strong><?php comment_author(); ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
     931
     932<?php comment_text() ?>
     933
     934<p><?php comment_date(__('M j, g:i A'));  ?> &#8212; [
     935<?php
     936if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
     937    echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" .  __('Edit') . '</a>';
     938    echo ' | <a href="' . wp_nonce_url('ocomment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';
     939    if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
     940        echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';
     941        echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';
     942    }
     943    echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=" . $comment->comment_post_ID . "&amp;c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ";
     944}
     945$post = get_post($comment->comment_post_ID);
     946$post_title = wp_specialchars( $post->post_title, 'double' );
     947$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
     948?>
     949 ] &#8212; <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a></p>
     950        </li>
     951<?php
    875952}
    876953
     
    11321209            $state = true;
    11331210            foreach ( $markerdata as $n => $markerline ) {
    1134                 if ( strstr( $markerline, "# BEGIN {$marker}" ))
     1211                if (strpos($markerline, '# BEGIN ' . $marker) !== false)
    11351212                    $state = false;
    11361213                if ( $state ) {
     
    11401217                        fwrite( $f, "{$markerline}" );
    11411218                }
    1142                 if ( strstr( $markerline, "# END {$marker}" ) ) {
     1219                if (strpos($markerline, '# END ' . $marker) !== false) {
    11431220                    fwrite( $f, "# BEGIN {$marker}\n" );
    11441221                    if ( is_array( $insertion ))
     
    11781255        $state = false;
    11791256        foreach ( $markerdata as $markerline ) {
    1180             if ( strstr( $markerline, "# END {$marker}" ))
     1257            if (strpos($markerline, '# END ' . $marker) !== false)
    11811258                $state = false;
    11821259            if ( $state )
    11831260                $result[] = $markerline;
    1184             if ( strstr( $markerline, "# BEGIN {$marker}" ))
     1261            if (strpos($markerline, '# BEGIN ' . $marker) !== false)
    11851262                $state = true;
    11861263        }
     
    12701347    if ( $items ) {
    12711348        foreach ( $items as $item ) {
    1272             // A page cannot be it's own parent.
     1349            // A page cannot be its own parent.
    12731350            if (!empty ( $post_ID ) ) {
    12741351                if ( $item->ID == $post_ID ) {
     
    13051382    if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
    13061383        return false;
    1307    
     1384
    13081385    if ( empty( $parent) ) {
    13091386        if ( isset( $_wp_menu_nopriv[$pagenow] ) )
     
    13171394                return false;
    13181395            if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) )
    1319             return false;   
     1396            return false;
    13201397        }
    13211398        return true;
     
    14391516                    $parent_file = $_wp_real_parent_file[$parent_file];
    14401517            return $parent_file;
    1441         }           
     1518        }
    14421519    }
    14431520
     
    14461523        if ( isset( $_wp_real_parent_file[$parent_file] ) )
    14471524            $parent_file = $_wp_real_parent_file[$parent_file];
    1448         return $parent_file;       
     1525        return $parent_file;
    14491526    }
    14501527
     
    15341611}
    15351612
     1613function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
     1614    if ( current_user_can('edit_users') )
     1615        $parent = 'users.php';
     1616    else
     1617        $parent = 'profile.php';
     1618    return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function );
     1619}
     1620
    15361621function validate_file( $file, $allowed_files = '' ) {
    15371622    if ( false !== strpos( $file, './' ))
     
    16031688    elseif ( file_exists( ABSPATH . $file ) && is_file( ABSPATH . $file ) ) {
    16041689        $template_data = implode( '', file( ABSPATH . $file ) );
    1605         if ( preg_match( "|Template Name:(.* )|i", $template_data, $name ))
     1690        if ( preg_match( "|Template Name:(.*)|i", $template_data, $name ))
    16061691            return $name[1];
    16071692    }
     
    16521737    }
    16531738
    1654     return array ('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1] );
     1739    return array('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version);
    16551740}
    16561741
     
    16691754    if ( $plugins_dir ) {
    16701755        while (($file = $plugins_dir->read() ) !== false ) {
    1671             if ( preg_match( '|^\.+$|', $file ))
     1756            if ( substr($file, 0, 1) == '.' )
    16721757                continue;
    16731758            if ( is_dir( $plugin_root.'/'.$file ) ) {
     
    16751760                if ( $plugins_subdir ) {
    16761761                    while (($subfile = $plugins_subdir->read() ) !== false ) {
    1677                         if ( preg_match( '|^\.+$|', $subfile ))
     1762                        if ( substr($subfile, 0, 1) == '.' )
    16781763                            continue;
    1679                         if ( preg_match( '|\.php$|', $subfile ))
     1764                        if ( substr($subfile, -4) == '.php' )
    16801765                            $plugin_files[] = "$file/$subfile";
    16811766                    }
    16821767                }
    16831768            } else {
    1684                 if ( preg_match( '|\.php$|', $file ))
     1769                if ( substr($file, -4) == '.php' )
    16851770                    $plugin_files[] = $file;
    16861771            }
     
    17471832        ';
    17481833}
    1749 if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ))
     1834
     1835if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
    17501836    add_action( 'admin_footer', 'browse_happy' );
    17511837
     
    17621848function get_importers() {
    17631849    global $wp_importers;
    1764 
     1850    uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
    17651851    return $wp_importers;
    17661852}
     
    18861972    // Compute the URL
    18871973    $url = $uploads['url'] . "/$filename";
    1888    
     1974
    18891975    $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
    18901976
     
    19081994    $size = strtolower( ini_get( 'upload_max_filesize' ) );
    19091995    $bytes = 0;
    1910     if ( strstr( $size, 'k' ) )
     1996    if (strpos($size, 'k') !== false)
    19111997        $bytes = $size * 1024;
    1912     if ( strstr( $size, 'm' ) )
     1998    if (strpos($size, 'm') !== false)
    19131999        $bytes = $size * 1024 * 1024;
    1914     if ( strstr( $size, 'g' ) )
     2000    if (strpos($size, 'g') !== false)
    19152001        $bytes = $size * 1024 * 1024 * 1024;
    19162002?>
    1917 <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo $action ?>">
     2003<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo attribute_escape($action) ?>">
    19182004<p>
     2005<?php wp_nonce_field('import-upload'); ?>
    19192006<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?> )
    19202007<input type="file" id="upload" name="import" size="25" />
     
    20452132    wp_clearcookie();
    20462133    // Set cookies for new paths.
    2047     wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' ));   
     2134    wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' ));
    20482135}
    20492136
     
    20672154    }
    20682155
    2069     imageantialias( $dst, true );
     2156    if (function_exists('imageantialias'))
     2157        imageantialias( $dst, true );
     2158   
    20702159    imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
    20712160
     
    21872276            // If no filters change the filename, we'll do a default transformation.
    21882277            if ( basename( $file ) == $thumb = apply_filters( 'thumbnail_filename', basename( $file ) ) )
    2189                 $thumb = preg_replace( '!(\.[^.]+)?$!', __( '.thumbnail' ).'$1', basename( $file ), 1 );
     2278                $thumb = preg_replace( '!(\.[^.]+)?$!', '.thumbnail' . '$1', basename( $file ), 1 );
    21902279
    21912280            $thumbpath = str_replace( basename( $file ), $thumb, $file );
    21922281
    2193             // move the thumbnail to it's final destination
     2282            // move the thumbnail to its final destination
    21942283            if ( $type[2] == 1 ) {
    21952284                if (!imagegif( $thumbnail, $thumbpath ) ) {
     
    22162305        return $error;
    22172306    } else {
    2218         apply_filters( 'wp_create_thumbnail', $thumbpath );
    2219         return $thumbpath;
     2307        return apply_filters( 'wp_create_thumbnail', $thumbpath );
    22202308    }
    22212309}
Note: See TracChangeset for help on using the changeset viewer.