Changes from branches/2.6/wp-includes/functions.php at r8571 to trunk/wp-includes/functions.php at r8280
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r8571 r8280 342 342 if ( false === $value ) { 343 343 if ( defined( 'WP_INSTALLING' ) ) 344 $sup press = $wpdb->suppress_errors();344 $supress = $wpdb->suppress_errors(); 345 345 // expected_slashed ($setting) 346 346 $row = $wpdb->get_row( "SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1" ); … … 631 631 */ 632 632 function 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 ) ) 634 636 return serialize( $data ); 635 636 637 if ( is_serialized( $data ) ) 637 638 return serialize( $data ); 638 639 639 return $data; 640 640 } … … 1482 1482 $siteurl = get_option( 'siteurl' ); 1483 1483 $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; 1489 1487 1490 1488 // $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'; 1499 1493 1500 1494 if ( defined('UPLOADS') ) { … … 1524 1518 return array( 'error' => $message ); 1525 1519 } 1526 1520 1527 1521 $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false ); 1528 1529 1522 return apply_filters( 'upload_dir', $uploads ); 1530 1523 }
Note: See TracChangeset
for help on using the changeset viewer.