From 2f726406acf11cd4d12c0ec939c53444b1863f64 Mon Sep 17 00:00:00 2001 From: lucha <lucha@paranoici.org> Date: Tue, 3 Oct 2017 17:24:49 +0200 Subject: [PATCH] patch: stops wordpress from hardcoding the location of debug.log by default, if DEBUG_LOG is true, wordpress will set error_log to wp-content/debug.log, which is publicly accessible. We want instead to set it via our own php.ini. This patch removes the Wordpress code responsible for modifying the error_log location. --- wp-includes/load.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/load.php b/wp-includes/load.php index c7a46de5c..d824af140 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -327,7 +327,8 @@ function wp_debug_mode() { if ( WP_DEBUG_LOG ) { ini_set( 'log_errors', 1 ); - ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' ); + // AI patch: do not hardcode the debug.log location, let php.in set it + // ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' ); } } else { 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 ); -- GitLab