Changes from branches/2.2/wp-admin/admin-functions.php at r5453 to trunk/wp-admin/admin-functions.php at r4760
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r5453 r4760 23 23 24 24 // Check for autosave collisions 25 $temp_id = false;26 25 if ( isset($_POST['temp_ID']) ) { 27 26 $temp_id = (int) $_POST['temp_ID']; … … 35 34 $_POST['post_ID'] = $draft_ids[$temp_id]; 36 35 unset($_POST['temp_ID']); 36 relocate_children( $temp_id, $_POST['post_ID'] ); 37 37 update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids ); 38 38 return edit_post(); … … 113 113 114 114 // 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 122 115 // Update autosave collision detection 123 116 if ( $temp_id ) { 117 relocate_children( $temp_id, $post_ID ); 124 118 $draft_ids[$temp_id] = $post_ID; 125 119 update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids ); … … 146 140 $post = & get_post( $post_ID, ARRAY_A ); 147 141 148 $search = "#<a[^>]+rel=('|\" )[^'\"]*attachment[^>]*>#ie";142 $search = "#<a[^>]+rel=('|\" )[^'\"]*attachment[^>]*>#ie"; 149 143 150 144 // See if we have any rel="attachment" links … … 153 147 154 148 $i = 0; 155 $search = "#[\s]+rel=(\"|' )(.*?)wp-att-(\d+)\\1#i";149 $search = "#[\s]+rel=(\"|' )(.*? )wp-att-(\d+ )\\1#i"; 156 150 foreach ( $anchor_matches[0] as $anchor ) { 157 151 if ( 0 == preg_match( $search, $anchor, $id_matches ) ) 158 152 continue; 159 153 160 $id = (int)$id_matches[3];154 $id = $id_matches[3]; 161 155 162 156 // While we have the attachment ID, let's adopt any orphans. … … 286 280 add_meta( $post_ID ); 287 281 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 ); 282 wp_update_post( $_POST); 295 283 296 284 // Now that we have an ID we can fix any attachment anchor hrefs … … 371 359 $text = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) ); 372 360 $text = funky_javascript_fix( $text); 373 $popupurl = clean_url($_REQUEST['popupurl']);361 $popupurl = attribute_escape($_REQUEST['popupurl']); 374 362 $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 375 363 } … … 430 418 $user->user_login = attribute_escape($user->user_login); 431 419 $user->user_email = attribute_escape($user->user_email); 432 $user->user_url = clean_url($user->user_url);420 $user->user_url = attribute_escape($user->user_url); 433 421 $user->first_name = attribute_escape($user->first_name); 434 422 $user->last_name = attribute_escape($user->last_name); … … 448 436 if ( func_num_args() ) { // The hackiest hack that ever did hack 449 437 global $current_user, $wp_roles; 450 $user_id = (int)func_get_arg( 0 );438 $user_id = func_get_arg( 0 ); 451 439 452 440 if ( isset( $_POST['role'] ) ) { … … 466 454 if ( $user_id != 0 ) { 467 455 $update = true; 468 $user->ID = (int)$user_id;456 $user->ID = $user_id; 469 457 $userdata = get_userdata( $user_id ); 470 458 $user->user_login = $wpdb->escape( $userdata->user_login ); … … 491 479 $user->user_email = wp_specialchars( trim( $_POST['email'] )); 492 480 if ( isset( $_POST['url'] ) ) { 493 $user->user_url = clean_url( trim( $_POST['url'] ));481 $user->user_url = wp_specialchars( trim( $_POST['url'] )); 494 482 $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; 495 483 } … … 575 563 $link = get_link( $link_id ); 576 564 577 $link->link_url = clean_url($link->link_url);565 $link->link_url = attribute_escape($link->link_url); 578 566 $link->link_name = attribute_escape($link->link_name); 579 567 $link->link_image = attribute_escape($link->link_image); 580 568 $link->link_description = attribute_escape($link->link_description); 581 $link->link_rss = clean_url($link->link_rss);569 $link->link_rss = attribute_escape($link->link_rss); 582 570 $link->link_rel = attribute_escape($link->link_rel); 583 571 $link->link_notes = wp_specialchars($link->link_notes); … … 589 577 function get_default_link_to_edit() { 590 578 if ( isset( $_GET['linkurl'] ) ) 591 $link->link_url = clean_url( $_GET['linkurl']);579 $link->link_url = attribute_escape( $_GET['linkurl']); 592 580 else 593 581 $link->link_url = ''; … … 612 600 613 601 $_POST['link_url'] = wp_specialchars( $_POST['link_url'] ); 614 $_POST['link_url'] = clean_url($_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']; 615 603 $_POST['link_name'] = wp_specialchars( $_POST['link_name'] ); 616 604 $_POST['link_image'] = wp_specialchars( $_POST['link_image'] ); 617 $_POST['link_rss'] = clean_url($_POST['link_rss']);605 $_POST['link_rss'] = wp_specialchars( $_POST['link_rss'] ); 618 606 $_POST['link_category'] = $_POST['post_category']; 619 607 … … 682 670 // No selected categories, strange 683 671 $checked_categories[] = $default; 684 } 672 } 685 673 } else { 686 674 $checked_categories[] = $default; … … 706 694 function write_nested_categories( $categories ) { 707 695 foreach ( $categories as $category ) { 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>";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>"; 709 697 710 698 if ( $category['children'] ) { … … 738 726 // No selected categories, strange 739 727 $checked_categories[] = $default; 740 } 728 } 741 729 } else { 742 730 $checked_categories[] = $default; … … 769 757 $categories = get_categories( 'hide_empty=0' ); 770 758 771 $children = _get_category_hierarchy();772 773 759 if ( $categories ) { 774 760 ob_start(); … … 776 762 if ( $category->category_parent == $parent) { 777 763 echo "\t" . _cat_row( $category, $level ); 778 if ( isset($children[$category->cat_ID]) ) 779 cat_rows( $category->cat_ID, $level +1, $categories ); 764 cat_rows( $category->cat_ID, $level +1, $categories ); 780 765 } 781 766 } 782 767 $output = ob_get_contents(); 783 768 ob_end_clean(); 784 769 785 770 $output = apply_filters('cat_rows', $output); 786 771 … … 797 782 if ( current_user_can( 'manage_categories' ) ) { 798 783 $edit = "<a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>".__( 'Edit' )."</a></td>"; 799 $default_cat_id = (int)get_option( 'default_category' );800 $default_link_cat_id = (int)get_option( 'default_link_category' );784 $default_cat_id = get_option( 'default_category' ); 785 $default_link_cat_id = get_option( 'default_link_category' ); 801 786 802 787 if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) ) 803 $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&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>";788 $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&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>"; 804 789 else 805 790 $edit .= "<td style='text-align:center'>".__( "Default" ); … … 837 822 $post->post_title = wp_specialchars( $post->post_title ); 838 823 $pad = str_repeat( '— ', $level ); 839 $id = (int)$post->ID;824 $id = $post->ID; 840 825 $class = ('alternate' == $class ) ? '' : 'alternate'; 841 826 ?> … … 846 831 </td> 847 832 <td><?php the_author() ?></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>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> 849 834 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e( 'View' ); ?></a></td> 850 835 <td><?php if ( current_user_can( 'edit_page', $id ) ) { echo "<a href='page.php?action=edit&post=$id' class='edit'>" . __( 'Edit' ) . "</a>"; } ?></td> … … 883 868 $r .= "</td>\n\t\t<td>"; 884 869 if ( current_user_can( 'edit_user', $user_object->ID ) ) { 885 $edit_link = a dd_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$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" )); 886 871 $r .= "<a href='$edit_link' class='edit'>".__( 'Edit' )."</a>"; 887 872 } 888 873 $r .= "</td>\n\t</tr>"; 889 874 return $r; 890 }891 892 function _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 WHERE901 (comment_author LIKE '%$s%' OR902 comment_author_email LIKE '%$s%' OR903 comment_author_url LIKE ('%$s%') OR904 comment_author_IP LIKE ('%$s%') OR905 comment_content LIKE ('%$s%') ) AND906 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 917 function _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')); ?> — [935 <?php936 if ( current_user_can('edit_post', $comment->comment_post_ID) ) {937 echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."'>" . __('Edit') . '</a>';938 echo ' | <a href="' . wp_nonce_url('ocomment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&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&p=' . $comment->comment_post_ID . '&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&p=' . $comment->comment_post_ID . '&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&dt=spam&p=" . $comment->comment_post_ID . "&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 ] — <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a></p>950 </li>951 <?php952 875 } 953 876 … … 1209 1132 $state = true; 1210 1133 foreach ( $markerdata as $n => $markerline ) { 1211 if ( strpos($markerline, '# BEGIN ' . $marker) !== false)1134 if ( strstr( $markerline, "# BEGIN {$marker}" )) 1212 1135 $state = false; 1213 1136 if ( $state ) { … … 1217 1140 fwrite( $f, "{$markerline}" ); 1218 1141 } 1219 if ( strpos($markerline, '# END ' . $marker) !== false) {1142 if ( strstr( $markerline, "# END {$marker}" ) ) { 1220 1143 fwrite( $f, "# BEGIN {$marker}\n" ); 1221 1144 if ( is_array( $insertion )) … … 1255 1178 $state = false; 1256 1179 foreach ( $markerdata as $markerline ) { 1257 if ( strpos($markerline, '# END ' . $marker) !== false)1180 if ( strstr( $markerline, "# END {$marker}" )) 1258 1181 $state = false; 1259 1182 if ( $state ) 1260 1183 $result[] = $markerline; 1261 if ( strpos($markerline, '# BEGIN ' . $marker) !== false)1184 if ( strstr( $markerline, "# BEGIN {$marker}" )) 1262 1185 $state = true; 1263 1186 } … … 1347 1270 if ( $items ) { 1348 1271 foreach ( $items as $item ) { 1349 // A page cannot be it s own parent.1272 // A page cannot be it's own parent. 1350 1273 if (!empty ( $post_ID ) ) { 1351 1274 if ( $item->ID == $post_ID ) { … … 1382 1305 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 1383 1306 return false; 1384 1307 1385 1308 if ( empty( $parent) ) { 1386 1309 if ( isset( $_wp_menu_nopriv[$pagenow] ) ) … … 1394 1317 return false; 1395 1318 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) ) 1396 return false; 1319 return false; 1397 1320 } 1398 1321 return true; … … 1516 1439 $parent_file = $_wp_real_parent_file[$parent_file]; 1517 1440 return $parent_file; 1518 } 1441 } 1519 1442 } 1520 1443 … … 1523 1446 if ( isset( $_wp_real_parent_file[$parent_file] ) ) 1524 1447 $parent_file = $_wp_real_parent_file[$parent_file]; 1525 return $parent_file; 1448 return $parent_file; 1526 1449 } 1527 1450 … … 1611 1534 } 1612 1535 1613 function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {1614 if ( current_user_can('edit_users') )1615 $parent = 'users.php';1616 else1617 $parent = 'profile.php';1618 return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function );1619 }1620 1621 1536 function validate_file( $file, $allowed_files = '' ) { 1622 1537 if ( false !== strpos( $file, './' )) … … 1688 1603 elseif ( file_exists( ABSPATH . $file ) && is_file( ABSPATH . $file ) ) { 1689 1604 $template_data = implode( '', file( ABSPATH . $file ) ); 1690 if ( preg_match( "|Template Name:(.* )|i", $template_data, $name ))1605 if ( preg_match( "|Template Name:(.* )|i", $template_data, $name )) 1691 1606 return $name[1]; 1692 1607 } … … 1737 1652 } 1738 1653 1739 return array ('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version);1654 return array ('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1] ); 1740 1655 } 1741 1656 … … 1754 1669 if ( $plugins_dir ) { 1755 1670 while (($file = $plugins_dir->read() ) !== false ) { 1756 if ( substr($file, 0, 1) == '.')1671 if ( preg_match( '|^\.+$|', $file )) 1757 1672 continue; 1758 1673 if ( is_dir( $plugin_root.'/'.$file ) ) { … … 1760 1675 if ( $plugins_subdir ) { 1761 1676 while (($subfile = $plugins_subdir->read() ) !== false ) { 1762 if ( substr($subfile, 0, 1) == '.')1677 if ( preg_match( '|^\.+$|', $subfile )) 1763 1678 continue; 1764 if ( substr($subfile, -4) == '.php')1679 if ( preg_match( '|\.php$|', $subfile )) 1765 1680 $plugin_files[] = "$file/$subfile"; 1766 1681 } 1767 1682 } 1768 1683 } else { 1769 if ( substr($file, -4) == '.php')1684 if ( preg_match( '|\.php$|', $file )) 1770 1685 $plugin_files[] = $file; 1771 1686 } … … 1832 1747 '; 1833 1748 } 1834 1835 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) 1749 if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'MSIE' )) 1836 1750 add_action( 'admin_footer', 'browse_happy' ); 1837 1751 … … 1848 1762 function get_importers() { 1849 1763 global $wp_importers; 1850 uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);')); 1764 1851 1765 return $wp_importers; 1852 1766 } … … 1972 1886 // Compute the URL 1973 1887 $url = $uploads['url'] . "/$filename"; 1974 1888 1975 1889 $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); 1976 1890 … … 1994 1908 $size = strtolower( ini_get( 'upload_max_filesize' ) ); 1995 1909 $bytes = 0; 1996 if ( strpos($size, 'k') !== false)1910 if ( strstr( $size, 'k' ) ) 1997 1911 $bytes = $size * 1024; 1998 if ( strpos($size, 'm') !== false)1912 if ( strstr( $size, 'm' ) ) 1999 1913 $bytes = $size * 1024 * 1024; 2000 if ( strpos($size, 'g') !== false)1914 if ( strstr( $size, 'g' ) ) 2001 1915 $bytes = $size * 1024 * 1024 * 1024; 2002 1916 ?> 2003 <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo attribute_escape($action)?>">1917 <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo $action ?>"> 2004 1918 <p> 2005 <?php wp_nonce_field('import-upload'); ?>2006 1919 <label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?> ) 2007 1920 <input type="file" id="upload" name="import" size="25" /> … … 2132 2045 wp_clearcookie(); 2133 2046 // Set cookies for new paths. 2134 wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' )); 2047 wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' )); 2135 2048 } 2136 2049 … … 2154 2067 } 2155 2068 2156 if (function_exists('imageantialias')) 2157 imageantialias( $dst, true ); 2158 2069 imageantialias( $dst, true ); 2159 2070 imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ); 2160 2071 … … 2276 2187 // If no filters change the filename, we'll do a default transformation. 2277 2188 if ( basename( $file ) == $thumb = apply_filters( 'thumbnail_filename', basename( $file ) ) ) 2278 $thumb = preg_replace( '!(\.[^.]+)?$!', '.thumbnail' .'$1', basename( $file ), 1 );2189 $thumb = preg_replace( '!(\.[^.]+)?$!', __( '.thumbnail' ).'$1', basename( $file ), 1 ); 2279 2190 2280 2191 $thumbpath = str_replace( basename( $file ), $thumb, $file ); 2281 2192 2282 // move the thumbnail to it s final destination2193 // move the thumbnail to it's final destination 2283 2194 if ( $type[2] == 1 ) { 2284 2195 if (!imagegif( $thumbnail, $thumbpath ) ) { … … 2305 2216 return $error; 2306 2217 } else { 2307 return apply_filters( 'wp_create_thumbnail', $thumbpath ); 2218 apply_filters( 'wp_create_thumbnail', $thumbpath ); 2219 return $thumbpath; 2308 2220 } 2309 2221 }
Note: See TracChangeset
for help on using the changeset viewer.