Ticket #25449: 25449.3.diff
| File 25449.3.diff, 2.6 KB (added by , 10 years ago) |
|---|
-
wp-includes/functions.php
1846 1846 * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. 1847 1847 * @param bool $create_dir Optional. Whether to check and create the uploads directory. Default true (backwards compatible). 1848 1848 * @param bool $refresh_cache Optional. Whether to refresh the cache. Default false. 1849 * @param string $scheme Optional. Scheme to give the uploads url context. See set_url_scheme(). 1849 1850 * @return array See above for description. 1850 1851 */ 1851 function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false ) {1852 function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false, $scheme = null ) { 1852 1853 static $cache = array(); 1853 1854 1854 $key = sprintf( '%d-%s ', get_current_blog_id(), (string) $time );1855 $key = sprintf( '%d-%s-%s', get_current_blog_id(), (string) $time, (string) $scheme ); 1855 1856 1856 1857 if ( $refresh_cache || empty( $cache[ $key ] ) ) { 1857 $cache[ $key ] = _wp_upload_dir( $time );1858 $cache[ $key ] = _wp_upload_dir( $time, $scheme ); 1858 1859 } 1859 1860 1860 1861 /** … … 1900 1901 * @access private 1901 1902 * 1902 1903 * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. 1904 * @param string $scheme Optional. Scheme to give the uploads url context. See set_url_scheme(). 1903 1905 * @return array See wp_upload_dir() 1904 1906 */ 1905 function _wp_upload_dir( $time = null ) {1907 function _wp_upload_dir( $time = null, $scheme = null ) { 1906 1908 $siteurl = get_option( 'siteurl' ); 1907 1909 $upload_path = trim( get_option( 'upload_path' ) ); 1908 1910 … … 1974 1976 $url = trailingslashit( $siteurl ) . 'files'; 1975 1977 } 1976 1978 } 1979 1980 $url = set_url_scheme( $url, $scheme ); 1977 1981 1978 1982 $basedir = $dir; 1979 1983 $baseurl = $url; -
wp-includes/media.php
333 333 334 334 list( $img_src, $width, $height ) = image_downsize($id, $size); 335 335 $hwstring = image_hwstring($width, $height); 336 337 // Determine the scheme of the image source URL 338 if ( $url = get_option( 'upload_url_path' ) ) { 339 $scheme = parse_url( $url, PHP_URL_SCHEME ); 340 } else { 341 /* 342 * The upload_url_path option is not set. Therefore, use the scheme 343 * of the WP_CONTENT_URL constant. If it is not set by the user, it 344 * defaults to the siteurl option. 345 */ 346 $scheme = parse_url( WP_CONTENT_URL, PHP_URL_SCHEME ); 347 } 348 349 $img_src = set_url_scheme( $img_src, $scheme ); 336 350 337 351 $title = $title ? 'title="' . esc_attr( $title ) . '" ' : ''; 338 352