EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/90453
Change subject: Remove 'Debug' hook from wfDebug and wfDebugLog
......................................................................
Remove 'Debug' hook from wfDebug and wfDebugLog
Per the bug report, the 'Debug' hook was triggering an infinite loop when
wgDebugFunctionEntry is enabled. The Debug hook is used if an extension wants
to stop a debug message from being sent out. Ideally the wfDebug and related
functions should be as low-level and avoid calling other code as much as
possible to avoid situations like this.
Bug: 55818
Change-Id: I679782489b683503fc624cfea3c7ad72a989b005
---
M RELEASE-NOTES-1.22
M docs/hooks.txt
M includes/GlobalFunctions.php
3 files changed, 9 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/53/90453/1
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 289f008..2171dba 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -329,6 +329,8 @@
* (bug 47191) Fixed "Column 'si_title' cannot be part of FULLTEXT index"
MySQL error when installing using the binary character set option.
* (bug 45288) Support mysqli PHP extension
+* (bug 55818) BREAKING CHANGE: Removed undocumented 'Debug' hook in wfDebug.
+ This resolves an infinite loop when using $wgDebugFunctionEntry = true.
=== API changes in 1.22 ===
* (bug 25553) The JSON output formatter now leaves forward slashes unescaped
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 53993de..26032cb 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -866,10 +866,6 @@
'DatabaseOraclePostInit': Called after initialising an Oracle database
&$db: the DatabaseOracle object
-'Debug': Called when outputting a debug log line via wfDebug() or wfDebugLog()
-$text: plaintext string to be output
-$group: null or a string naming a logging group (as defined in
$wgDebugLogGroups)
-
'NewDifferenceEngine': Called when a new DifferenceEngine object is made
$title: the diff page title (nullable)
&$oldId: the actual old Id to use in the diff
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 8241d81..f2a8dab 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -931,14 +931,12 @@
MWDebug::debugMsg( $text );
}
- if ( wfRunHooks( 'Debug', array( $text, null /* no log group */ ) ) ) {
- if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
- # Strip unprintables; they can switch terminal modes
when binary data
- # gets dumped, which is pretty annoying.
- $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!',
' ', $text );
- $text = $wgDebugLogPrefix . $text;
- wfErrorLog( $text, $wgDebugLogFile );
- }
+ if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
+ # Strip unprintables; they can switch terminal modes when
binary data
+ # gets dumped, which is pretty annoying.
+ $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ',
$text );
+ $text = $wgDebugLogPrefix . $text;
+ wfErrorLog( $text, $wgDebugLogFile );
}
}
@@ -1013,9 +1011,7 @@
$time = wfTimestamp( TS_DB );
$wiki = wfWikiID();
$host = wfHostname();
- if ( wfRunHooks( 'Debug', array( $text, $logGroup ) ) ) {
- wfErrorLog( "$time $host $wiki: $text",
$wgDebugLogGroups[$logGroup] );
- }
+ wfErrorLog( "$time $host $wiki: $text",
$wgDebugLogGroups[$logGroup] );
} elseif ( $public === true ) {
wfDebug( "[$logGroup] $text", false );
}
--
To view, visit https://gerrit.wikimedia.org/r/90453
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I679782489b683503fc624cfea3c7ad72a989b005
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits