[wp-trac] [WordPress Trac] #33999: WordPress Update issue

WordPress Trac noreply at wordpress.org
Mon Jul 25 14:46:42 UTC 2016


#33999: WordPress Update issue
-----------------------------+-----------------------------
 Reporter:  MrZen88          |       Owner:  SergeyBiryukov
     Type:  defect (bug)     |      Status:  reopened
 Priority:  normal           |   Milestone:  4.6
Component:  Upgrade/Install  |     Version:  4.2.2
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+-----------------------------
Changes (by ocean90):

 * keywords:  has-patch dev-feedback => has-patch
 * status:  closed => reopened
 * resolution:  invalid =>
 * milestone:   => 4.6


Old description:

> When I update the core or a plugin with ftp the website always stuck un
> the «Enabling maintenance mode». I saw the solution on the forum:
> https://wordpress.org/support/topic/unable-to-update-plugins-after-
> upgrade-to-42/page/3
>
> You need to modify the ligne 149 in the file wp-admin/includes/file.php
>
> if ( empty( $filename ) || '.' == $filename || '/' === $filename ) {
>
> replace with
>
> if ( empty( $filename ) || '.' == $filename || DIRECTORY_SEPARATOR ===
> $filename ) {
>
> In windows you need to do that to the upgrade work.

New description:

 When I update the core or a plugin with ftp the website always stuck un
 the «Enabling maintenance mode». I saw the solution on the forum:
 https://wordpress.org/support/topic/unable-to-update-plugins-after-
 upgrade-to-42/page/3

 You need to modify the ligne 149 in the file wp-admin/includes/file.php

 {{{
 if ( empty( $filename ) || '.' == $filename || '/' === $filename ) {
 }}}

 replace with

 {{{
 if ( empty( $filename ) || '.' == $filename || DIRECTORY_SEPARATOR ===
 $filename ) {
 }}}

 In windows you need to do that to the upgrade work.

--

Comment:

 @neogeneva gave the answer for this issue in [comment:ticket:36965:6]. I
 could reproduce this behaviour. Results of a few `dirname()` examples:

 ||        || Windows || *nix ||
 || `DIRECTORY_SEPARATOR` || `"\"`  || `"/"` ||
 || `dirname( '' )` || `""`  || `""` ||
 || `dirname( '/' )` || `"\"`  ||`"/"` ||
 || `dirname( 'file.php' )` || `"."`  ||`"."` ||
 || `dirname( '/.maintenance' )` || `"\"`  ||`"/"` ||

 [attachment:33999.patch] adds a check for a backslash.

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


More information about the wp-trac mailing list