Make WordPress Core


Ignore:
Location:
branches/2.8
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8/readme.html

    r12077 r12176  
    99<h1 id="logo" style="text-align: center">
    1010    <img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
    11     <br /> Version 2.8.5
     11    <br /> Version 2.8.6
    1212</h1>
    1313<p style="text-align: center">Semantic Personal Publishing Platform</p>
     
    3030<h1>Upgrading</h1>
    3131<p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p>
    32 <h2>Upgrading from any previous WordPress to 2.8.5:</h2>
     32<h2>Upgrading from any previous WordPress to 2.8.6:</h2>
    3333<ol>
    3434    <li>Delete your old WP files, saving ones you've modified.</li>
  • branches/2.8/wp-admin/press-this.php

    r12077 r12176  
    9292
    9393// Set Variables
    94 $title = isset($_GET['t']) ? esc_html(aposfix(stripslashes($_GET['t']))) : '';
    95 $selection = isset($_GET['s']) ? trim( aposfix( stripslashes($_GET['s']) ) ) : '';
     94$title = isset( $_GET['t'] ) ? trim( strip_tags( aposfix( stripslashes( $_GET['t'] ) ) ) ) : '';
     95$selection = isset( $_GET['s'] ) ? trim( htmlspecialchars( html_entity_decode( aposfix( stripslashes( $_GET['s'] ) ) ) ) ) : '';
    9696if ( ! empty($selection) ) {
    9797    $selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection);
     
    118118        <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
    119119        <div class="inside">
    120             <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo format_to_edit($selection, true); ?></textarea>
     120            <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo wp_htmledit_pre( $selection ); ?></textarea>
    121121            <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
    122122        </div>
     
    549549            <div class="editor-container">
    550550                <textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15">
    551                     <?php if ($selection) echo wp_richedit_pre(htmlspecialchars_decode($selection)); ?>
    552                     <?php if ($url) { echo '<p>'; if($selection) _e('via '); echo "<a href='$url'>$title</a>."; echo '</p>'; } ?>
     551                    <?php if ($selection) echo wp_richedit_pre( $selection ); ?>
     552                    <?php if ($url) { echo '<p>'; if($selection) _e('via '); printf( "<a href='%s'>%s</a>.", esc_url( $url ), esc_html( $title ) ); echo '</p>'; } ?>
    553553                </textarea>
    554554            </div>
  • branches/2.8/wp-includes/formatting.php

    r12077 r12176  
    606606    $filename = preg_replace('/[\s-]+/', '-', $filename);
    607607    $filename = trim($filename, '.-_');
     608
     609    // Split the filename into a base and extension[s]
     610    $parts = explode('.', $filename);
     611
     612    // Return if only one extension
     613    if ( count($parts) <= 2 )
     614        return apply_filters('sanitize_file_name', $filename, $filename_raw);
     615
     616    // Process multiple extensions
     617    $filename = array_shift($parts);
     618    $extension = array_pop($parts);
     619    $mimes = get_allowed_mime_types();
     620
     621    // Loop over any intermediate extensions.  Munge them with a trailing underscore if they are a 2 - 5 character
     622    // long alpha string not in the extension whitelist.
     623    foreach ( (array) $parts as $part) {
     624        $filename .= '.' . $part;
     625       
     626        if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) {
     627            $allowed = false;
     628            foreach ( $mimes as $ext_preg => $mime_match ) {
     629                $ext_preg = '!(^' . $ext_preg . ')$!i';
     630                if ( preg_match( $ext_preg, $part ) ) {
     631                    $allowed = true;
     632                    break;
     633                }
     634            }
     635            if ( !$allowed )
     636                $filename .= '_';
     637        }
     638    }
     639    $filename .= '.' . $extension;
     640
    608641    return apply_filters('sanitize_file_name', $filename, $filename_raw);
    609642}
  • branches/2.8/wp-includes/functions.php

    r12077 r12176  
    22272227 */
    22282228function wp_check_filetype( $filename, $mimes = null ) {
    2229     // Accepted MIME types are set here as PCRE unless provided.
    2230     $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array(
     2229    if ( empty($mimes) )
     2230        $mimes = get_allowed_mime_types();
     2231    $type = false;
     2232    $ext = false;
     2233
     2234    foreach ( $mimes as $ext_preg => $mime_match ) {
     2235        $ext_preg = '!\.(' . $ext_preg . ')$!i';
     2236        if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
     2237            $type = $mime_match;
     2238            $ext = $ext_matches[1];
     2239            break;
     2240        }
     2241    }
     2242
     2243    return compact( 'ext', 'type' );
     2244}
     2245
     2246/**
     2247 * Retrieve list of allowed mime types and file extensions.
     2248 *
     2249 * @since 2.8.6
     2250 *
     2251 * @return array Array of mime types keyed by the file extension regex corresponding to those types.
     2252 */
     2253function get_allowed_mime_types() {
     2254    static $mimes = false;
     2255
     2256    if ( !$mimes ) {
     2257        // Accepted MIME types are set here as PCRE unless provided.
     2258        $mimes = apply_filters( 'upload_mimes', array(
    22312259        'jpg|jpeg|jpe' => 'image/jpeg',
    22322260        'gif' => 'image/gif',
     
    22742302        'odb' => 'application/vnd.oasis.opendocument.database',
    22752303        'odf' => 'application/vnd.oasis.opendocument.formula',
    2276         )
    2277     );
    2278 
    2279     $type = false;
    2280     $ext = false;
    2281 
    2282     foreach ( $mimes as $ext_preg => $mime_match ) {
    2283         $ext_preg = '!\.(' . $ext_preg . ')$!i';
    2284         if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
    2285             $type = $mime_match;
    2286             $ext = $ext_matches[1];
    2287             break;
    2288         }
    2289     }
    2290 
    2291     return compact( 'ext', 'type' );
     2304        ) );
     2305    }
     2306
     2307    return $mimes;
    22922308}
    22932309
  • branches/2.8/wp-includes/js/swfupload/plugins/swfupload.speed.js

    • Property svn:eol-style set to native
  • branches/2.8/wp-includes/version.php

    r12077 r12176  
    99 * @global string $wp_version
    1010 */
    11 $wp_version = '2.8.5';
     11$wp_version = '2.8.6';
    1212
    1313/**
Note: See TracChangeset for help on using the changeset viewer.