[wp-trac] [WordPress Trac] #54385: Fatal error uploading media on PHP8

WordPress Trac noreply at wordpress.org
Tue Nov 16 20:19:57 UTC 2021


#54385: Fatal error uploading media on PHP8
-------------------------------------------------+-------------------------
 Reporter:  stevegs                              |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.9
Component:  Media                                |     Version:  2.5
 Severity:  normal                               |  Resolution:
 Keywords:  php8 has-patch needs-dev-note has-   |     Focuses:
  unit-tests                                     |
-------------------------------------------------+-------------------------

Comment (by TobiasBg):

 Some suggestions:

 In [attachment:"54385.9.diff"]
 * Use `str_contains()` (from PHP 8.0, but polyfilled in [52039]) instead
 of that `strpos()`
 * Remove an extra empty line
 * remove unnecessary `global $wpdb;`

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


More information about the wp-trac mailing list