WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#32164 closed defect (bug) (duplicate)

wp_tempnam gets into loop on ".maintenance" filename

Reported by: ridderr Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

During update to WP4.2.1 wp_tempnam gets into a loop when filename is ".maintanance".
Error logged is: Allowed memory size of 268435456 bytes exhausted (tried to allocate 65488 bytes) in /home/pi/wordpress/wp-admin/includes/file.php on line 159

I could solve this by adding the following:

        if ( ! $temp_filename ) {
/** begin added code **/
if (dirname ($filename) == "/")
        return dirname ($dir . "x") . $filename;
else
/** end added code **/
                return wp_tempnam( dirname( $filename ), $dir );
        }

Change History (1)

#1 @SergeyBiryukov
6 years ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #32135.

Note: See TracTickets for help on using tickets.