[wp-trac] [WordPress Trac] #32164: wp_tempnam gets into loop on ".maintenance" filename

WordPress Trac noreply at wordpress.org
Tue Apr 28 13:05:54 UTC 2015


#32164: wp_tempnam gets into loop on ".maintenance" filename
-----------------------------+------------------------
 Reporter:  ridderr          |       Owner:
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Upgrade/Install  |     Version:  4.2
 Severity:  normal           |  Resolution:  duplicate
 Keywords:                   |     Focuses:
-----------------------------+------------------------
Changes (by SergeyBiryukov):

 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Old description:

> 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 );
>         }

New description:

 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 );
         }
 }}}

--

Comment:

 Duplicate of #32135.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32164#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list