[wp-trac] [WordPress Trac] #51913: Potential `unsupported operand types` dashboard fatal on PHP8 + multisite + upload space check

WordPress Trac noreply at wordpress.org
Wed Dec 2 18:46:53 UTC 2020


#51913: Potential `unsupported operand types` dashboard fatal on PHP8 + multisite +
upload space check
-----------------------------+----------------------------------------
 Reporter:  iandunn          |       Owner:  iandunn
     Type:  defect (bug)     |      Status:  accepted
 Priority:  highest omg bbq  |   Milestone:  5.6
Component:  Administration   |     Version:
 Severity:  blocker          |  Resolution:
 Keywords:  php8 has-patch   |     Focuses:  administration, multisite
-----------------------------+----------------------------------------

Comment (by iandunn):

 Another condition that might be required to reproduce this is to have WP
 installed in a subdirectory, with a custom content directory a level above
 it. e.g.,

 {{{
 wp installed at: /home/foo/wordpress
 content dir at:  /home/foo/wp-content
 }}}

 ...and nginx config like:

 {{{
 server {
         root /home/foo/wordpress;

         location /wp-content/ {
                 root /home/foo;
         }
 }
 }}}

 ...and a `wp-config` like:

 {{{
 define( 'ABSPATH',        '/home/foo/wordpress'  );
 define( 'WP_CONTENT_DIR', '/home/foo/wp-content' );
 }}}

 In a setup like that, `$cache_path` will be equal to `$directory`, because
 `ABSPATH` isn't stripped out.

 Making sure the return value is an `int` might still be worth it, but the
 underlying cause seems to be that the code makes assumptions about how
 things are setup. That could cause other problems if we don't make it more
 robust.

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


More information about the wp-trac mailing list