[wp-trac] [WordPress Trac] #54877: Occasional PHP exception being thrown on WPDB/MySQLi connections

WordPress Trac noreply at wordpress.org
Sun Apr 10 06:59:11 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:  has-patch needs-testing needs-unit-  |     Focuses:
  tests 2nd-opinion                              |
-------------------------------------------------+-------------------------

Comment (by costdev):

 I think this docs issue is unlikely to lead to a change in PHP source.
 There are open issues for other pages where nullable parameters aren't
 shown as such.

 That said, if this change is desired:

  **ini_get**
  Returns the value of the configuration option as a string on success, or
 an empty string for null values. Returns false if the configuration option
 doesn't exist. [https://www.php.net/manual/en/function.ini-get.php
 PHP.net]

 For a `""` or `false` result, we'd have to set `$port` to `null` anyway in
 order to send the correct type to `mysqli_real_connect()`.

 {{{
 $port = ini_get( 'mysqli.default_port' );
 $port = $port ? $port : null;
 }}}

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


More information about the wp-trac mailing list