Changeset 56180 for trunk/src/wp-includes/class-wpdb.php
- Timestamp:
- 07/09/2023 09:46:24 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wpdb.php
r56066 r56180 2156 2156 } 2157 2157 2158 // We need to check for an IPv6 address first. 2159 // An IPv6 address will always contain at least two colons. 2158 /* 2159 * We need to check for an IPv6 address first. 2160 * An IPv6 address will always contain at least two colons. 2161 */ 2160 2162 if ( substr_count( $host, ':' ) > 1 ) { 2161 2163 $pattern = '#^(?:\[)?(?P<host>[0-9a-fA-F:]+)(?:\]:(?P<port>[\d]+))?#'; … … 2214 2216 2215 2217 for ( $tries = 1; $tries <= $this->reconnect_retries; $tries++ ) { 2216 // On the last try, re-enable warnings. We want to see a single instance 2217 // of the "unable to connect" message on the bail() screen, if it appears. 2218 /* 2219 * On the last try, re-enable warnings. We want to see a single instance 2220 * of the "unable to connect" message on the bail() screen, if it appears. 2221 */ 2218 2222 if ( $this->reconnect_retries === $tries && WP_DEBUG ) { 2219 2223 error_reporting( $error_reporting ); … … 2231 2235 } 2232 2236 2233 // If template_redirect has already happened, it's too late for wp_die()/dead_db(). 2234 // Let's just return and hope for the best. 2237 /* 2238 * If template_redirect has already happened, it's too late for wp_die()/dead_db(). 2239 * Let's just return and hope for the best. 2240 */ 2235 2241 if ( did_action( 'template_redirect' ) ) { 2236 2242 return false; … … 2265 2271 $this->bail( $message, 'db_connect_fail' ); 2266 2272 2267 // Call dead_db() if bail didn't die, because this database is no more. 2268 // It has ceased to be (at least temporarily). 2273 /* 2274 * Call dead_db() if bail didn't die, because this database is no more. 2275 * It has ceased to be (at least temporarily). 2276 */ 2269 2277 dead_db(); 2270 2278 } … … 2314 2322 if ( $this->check_current_query && ! $this->check_ascii( $query ) ) { 2315 2323 $stripped_query = $this->strip_invalid_text_from_query( $query ); 2316 // strip_invalid_text_from_query() can perform queries, so we need 2317 // to flush again, just to make sure everything is clear. 2324 /* 2325 * strip_invalid_text_from_query() can perform queries, so we need 2326 * to flush again, just to make sure everything is clear. 2327 */ 2318 2328 $this->flush(); 2319 2329 if ( $stripped_query !== $query ) { … … 2343 2353 $mysql_errno = mysqli_errno( $this->dbh ); 2344 2354 } else { 2345 // $dbh is defined, but isn't a real connection. 2346 // Something has gone horribly wrong, let's try a reconnect. 2355 /* 2356 * $dbh is defined, but isn't a real connection. 2357 * Something has gone horribly wrong, let's try a reconnect. 2358 */ 2347 2359 $mysql_errno = 2006; 2348 2360 } … … 3123 3135 return $this->last_result; 3124 3136 } elseif ( OBJECT_K === $output ) { 3125 // Return an array of row objects with keys from column 1. 3126 // (Duplicates are discarded.) 3137 /* 3138 * Return an array of row objects with keys from column 1. 3139 * (Duplicates are discarded.) 3140 */ 3127 3141 if ( $this->last_result ) { 3128 3142 foreach ( $this->last_result as $row ) { … … 3530 3544 } else { 3531 3545 $length = false; 3532 // Since we have no length, we'll never truncate. Initialize the variable to false. 3533 // True would take us through an unnecessary (for this case) codepath below. 3546 /* 3547 * Since we have no length, we'll never truncate. Initialize the variable to false. 3548 * True would take us through an unnecessary (for this case) codepath below. 3549 */ 3534 3550 $truncate_by_byte_length = false; 3535 3551 }
Note: See TracChangeset
for help on using the changeset viewer.