Changes from trunk/wp-includes/functions.php at r8280 to branches/2.6/wp-includes/functions.php at r8571
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/wp-includes/functions.php
r8280 r8571 342 342 if ( false === $value ) { 343 343 if ( defined( 'WP_INSTALLING' ) ) 344 $sup ress = $wpdb->suppress_errors();344 $suppress = $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_string( $data ) ) 634 return $data; 635 elseif ( is_array( $data ) || is_object( $data ) ) 633 if ( is_array( $data ) || is_object( $data ) ) 636 634 return serialize( $data ); 635 637 636 if ( is_serialized( $data ) ) 638 637 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 if ( trim($upload_path) === '' ) 1485 $upload_path = WP_CONTENT_DIR . '/uploads'; 1486 $dir = $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; 1487 1489 1488 1490 // $dir is absolute, $path is (maybe) relative to ABSPATH 1489 $dir = path_join( ABSPATH, $upload_path ); 1490 1491 if ( !$url = get_option( 'upload_url_path' ) ) 1492 $url = WP_CONTENT_URL . '/uploads'; 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 } 1493 1499 1494 1500 if ( defined('UPLOADS') ) { … … 1518 1524 return array( 'error' => $message ); 1519 1525 } 1520 1526 1521 1527 $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false ); 1528 1522 1529 return apply_filters( 'upload_dir', $uploads ); 1523 1530 }
Note: See TracChangeset
for help on using the changeset viewer.