Code Duplication    Length = 4-21 lines in 2 locations

src/wp-includes/functions.php 2 locations

@@ 1944-1947 (lines=4) @@
1941
	 * Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled.
1942
	 * We also sometimes obey UPLOADS when rewriting is enabled -- see the next block.
1943
	 */
1944
	if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) {
1945
		$dir = ABSPATH . UPLOADS;
1946
		$url = trailingslashit( $siteurl ) . UPLOADS;
1947
	}
1948
1949
	// If multisite (and if not the main site in a post-MU network)
1950
	if ( is_multisite() && ! ( is_main_network() && is_main_site() && defined( 'MULTISITE' ) ) ) {
@@ 1970-1990 (lines=21) @@
1967
			$dir .= $ms_dir;
1968
			$url .= $ms_dir;
1969
1970
		} elseif ( defined( 'UPLOADS' ) && ! ms_is_switched() ) {
1971
			/*
1972
			 * Handle the old-form ms-files.php rewriting if the network still has that enabled.
1973
			 * When ms-files rewriting is enabled, then we only listen to UPLOADS when:
1974
			 * 1) We are not on the main site in a post-MU network, as wp-content/uploads is used
1975
			 *    there, and
1976
			 * 2) We are not switched, as ms_upload_constants() hardcodes these constants to reflect
1977
			 *    the original blog ID.
1978
			 *
1979
			 * Rather than UPLOADS, we actually use BLOGUPLOADDIR if it is set, as it is absolute.
1980
			 * (And it will be set, see ms_upload_constants().) Otherwise, UPLOADS can be used, as
1981
			 * as it is relative to ABSPATH. For the final piece: when UPLOADS is used with ms-files
1982
			 * rewriting in multisite, the resulting URL is /files. (#WP22702 for background.)
1983
			 */
1984
1985
			if ( defined( 'BLOGUPLOADDIR' ) )
1986
				$dir = untrailingslashit( BLOGUPLOADDIR );
1987
			else
1988
				$dir = ABSPATH . UPLOADS;
1989
			$url = trailingslashit( $siteurl ) . 'files';
1990
		}
1991
	}
1992
1993
	$basedir = $dir;