Ticket #18391: 18391.3.diff
File 18391.3.diff, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-includes/load.php
307 307 * from changing the global configuration setting. Defining `WP_DEBUG_DISPLAY` 308 308 * as false will force errors to be hidden. 309 309 * 310 * When `WP_DEBUG_LOG` is true, errors will be logged to debug.log in the content311 * directory.310 * When `WP_DEBUG_LOG` is true, errors will be logged to `wp-content/debug.log`. 311 * When `WP_DEBUG_LOG` is a valid path, errors will be logged to the specified file. 312 312 * 313 313 * Errors are never displayed for XML-RPC, REST, and Ajax requests. 314 314 * 315 315 * @since 3.0.0 316 * @since 5.0.0 `WP_DEBUG_LOG` can be a file path. 316 317 * @access private 317 318 */ 318 319 function wp_debug_mode() { … … 341 342 ini_set( 'display_errors', 0 ); 342 343 } 343 344 344 if ( WP_DEBUG_LOG ) { 345 if ( in_array( strtolower( (string) WP_DEBUG_LOG ), array( 'true', '1' ), true ) ) { 346 $log_path = WP_CONTENT_DIR . '/debug.log'; 347 } elseif ( is_string( WP_DEBUG_LOG ) ) { 348 $log_path = WP_DEBUG_LOG; 349 } else { 350 $log_path = false; 351 } 352 353 if ( $log_path ) { 345 354 ini_set( 'log_errors', 1 ); 346 ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log');355 ini_set( 'error_log', $log_path ); 347 356 } 348 357 } else { 349 358 error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );