[wp-trac] [WordPress Trac] #54877: Occasional PHP exception being thrown on WPDB/MySQLi connections
WordPress Trac
noreply at wordpress.org
Thu Jan 27 17:57:43 UTC 2022
#54877: Occasional PHP exception being thrown on WPDB/MySQLi connections
-----------------------------------+---------------------
Reporter: johnjamesjacoby | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.0
Component: Database | Version: 1.5
Severity: normal | Resolution:
Keywords: 2nd-opinion has-patch | Focuses:
-----------------------------------+---------------------
Comment (by SergeyBiryukov):
Replying to [comment:3 johnjamesjacoby]:
> A more comprehensive change could refactor the following code, removing
the `foreach` loop & removing the only variable-variable (`$$component`)
in WordPress:
>
> {{{
> foreach ( array( 'host', 'port' ) as $component ) {
> if ( ! empty( $matches[ $component ] ) ) {
> $$component = $matches[ $component ];
> }
> }
> }}}
[attachment:"54877.patch"] looks good to me, but I think the latter
suggestion is also worth exploring, as this code looks unnecessarily
complicated :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54877#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list