Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r8571 r8280  
    342342        if ( false === $value ) {
    343343            if ( defined( 'WP_INSTALLING' ) )
    344                 $suppress = $wpdb->suppress_errors();
     344                $supress = $wpdb->suppress_errors();
    345345            // expected_slashed ($setting)
    346346            $row = $wpdb->get_row( "SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1" );
     
    631631 */
    632632function maybe_serialize( $data ) {
    633     if ( is_array( $data ) || is_object( $data ) )
     633    if ( is_string( $data ) )
     634        return $data;
     635    elseif ( is_array( $data ) || is_object( $data ) )
    634636        return serialize( $data );
    635 
    636637    if ( is_serialized( $data ) )
    637638        return serialize( $data );
    638 
    639639    return $data;
    640640}
     
    14821482    $siteurl = get_option( 'siteurl' );
    14831483    $upload_path = get_option( 'upload_path' );
    1484     $upload_path = trim($upload_path);
    1485     if ( empty($upload_path) )
    1486         $dir = WP_CONTENT_DIR . '/uploads';
    1487     else
    1488         $dir = $upload_path;
     1484    if ( trim($upload_path) === '' )
     1485        $upload_path = WP_CONTENT_DIR . '/uploads';
     1486    $dir = $upload_path;
    14891487
    14901488    // $dir is absolute, $path is (maybe) relative to ABSPATH
    1491     $dir = path_join( ABSPATH, $dir );
    1492    
    1493     if ( !$url = get_option( 'upload_url_path' ) ) {
    1494         if ( empty($upload_path) or ( $upload_path == $dir ) )
    1495             $url = WP_CONTENT_URL . '/uploads';
    1496         else
    1497             $url = trailingslashit( $siteurl ) . $upload_path;
    1498     }
     1489    $dir = path_join( ABSPATH, $upload_path );
     1490
     1491    if ( !$url = get_option( 'upload_url_path' ) )
     1492        $url = WP_CONTENT_URL . '/uploads';
    14991493
    15001494    if ( defined('UPLOADS') ) {
     
    15241518        return array( 'error' => $message );
    15251519    }
    1526    
     1520
    15271521    $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false );
    1528 
    15291522    return apply_filters( 'upload_dir', $uploads );
    15301523}
Note: See TracChangeset for help on using the changeset viewer.