WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 6 weeks ago

#54271 closed defect (bug) (duplicate)

Multisite on Windows - media upload infinite loop.

Reported by: ensemblebd Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.8.1
Component: Filesystem API Keywords:
Focuses: multisite Cc:

Description

You have a flaw in your code in /wp-includes/functions.php line # 8178.
:: clean_dirsize_cache

The while loop enters into an infinite loop UNLESS the path fed in starts with a slash.
And on windows multisite, the path is prefixed with the full directory meaning it starts with "C:\" , meaning infinite loop.
Which means file uploads never work due to a php timeout.
I had to modify my core wordpress.

So I modified: /wp-admin/includes/file.php line # 981 as such to resolve:
:: _wp_handle_upload

	if ( is_multisite() ) {
		$path = $new_file;
		if (DIRECTORY_SEPARATOR == "\\") { // windows flaw in wordpress..
			$parts = explode("wp-content", $path);
			$path = $parts[1];
		}
		clean_dirsize_cache( $path );
	}

Good day and good coffee.

Change History (1)

#1 @hellofromTonya
6 weeks ago

  • Component changed from General to Filesystem API
  • Focuses administration rest-api removed
  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Severity changed from major to normal
  • Status changed from new to closed

Hello @ensemblebd,

Welcome to WordPress Core's Trac. Thanks for the ticket!

This issue has already been reported in ticket #52241 and has a patch / fix that will be committed shortly. If you get the opportunity, I would appreciate if you could test the PR fix the the other ticket. The more folks who test it, the more likely the issue is solved.

Thank you for contributing!

Note: See TracTickets for help on using tickets.