Changes between Initial Version and Version 1 of Ticket #65953
- Timestamp:
- 08/24/2026 05:24:43 PM (3 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #65953 – Description
initial v1 2 2 I am a WordPress plugin developer. I was working on a plugin when, following a PHP update from version 7.4 to 8.2 (or higher), I encountered a strange error: 3 3 4 5 Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in / home/zgamesi1/domains/zgames.ir/public_html/wp-includes/rest-api/class-wp-rest-server.php:11664 {{{ 5 Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /.../wp-includes/rest-api/class-wp-rest-server.php:1166 6 6 Stack trace: 7 #0 /home/zgamesi1/domains/zgames.ir/public_html/wp-includes/rest-api/class-wp-rest-server.php(1166): array_merge(NULL) 7 #0 /.../wp-includes/rest-api/class-wp-rest-server.php(1166): array_merge(NULL) 8 }}} 8 9 9 10 In fact, line 1166 of the `class-wp-rest-server.php` file attempts to perform an `array_merge` without considering the variable's value or applying any specific validation; I resolved the error quite simply with a minor change: 10 11 11 Or ginal: $routes = array_merge( ...$with_namespace );12 Original: `$routes = array_merge( ...$with_namespace );` 12 13 Edited (Fixed): 14 {{{ 13 15 //Fixed by MDesign 14 16 foreach ( $with_namespace as $namespace_routes ) { … … 18 20 } 19 21 /**/ 22 }}}
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)