Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/242804
Change subject: Various getHTMLDebugLog() cleanups ...................................................................... Various getHTMLDebugLog() cleanups * Removed used Entering/Exiting stuff * Removed bogus empty entry on the first line Change-Id: I0ade132e04d745a21f4ec9fdd52a43b10d85e4d3 --- M includes/debug/MWDebug.php 1 file changed, 5 insertions(+), 43 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/04/242804/1 diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php index 1249eba..841636c 100644 --- a/includes/debug/MWDebug.php +++ b/includes/debug/MWDebug.php @@ -455,59 +455,21 @@ * @return string HTML fragment */ public static function getHTMLDebugLog() { - global $wgDebugTimestamps, $wgShowDebug; + global $wgShowDebug; if ( !$wgShowDebug ) { return ''; } - $curIdent = 0; - $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n<li>"; + $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n"; foreach ( self::$debug as $line ) { - $pre = ''; - if ( $wgDebugTimestamps ) { - $matches = array(); - if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) { - $pre = $matches[1]; - $line = substr( $line, strlen( $pre ) ); - } - } - $display = ltrim( $line ); - $ident = strlen( $line ) - strlen( $display ); - $diff = $ident - $curIdent; + $display = nl2br( htmlspecialchars( trim( $line ) ) ); - $display = $pre . $display; - if ( $display == '' ) { - $display = "\xc2\xa0"; - } - - if ( !$ident - && $diff < 0 - && substr( $display, 0, 9 ) != 'Entering ' - && substr( $display, 0, 8 ) != 'Exiting ' - ) { - $ident = $curIdent; - $diff = 0; - $display = '<span style="background:yellow;">' . - nl2br( htmlspecialchars( $display ) ) . '</span>'; - } else { - $display = nl2br( htmlspecialchars( $display ) ); - } - - if ( $diff < 0 ) { - $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n"; - } elseif ( $diff == 0 ) { - $ret .= "</li><li>\n"; - } else { - $ret .= str_repeat( "<ul><li>\n", $diff ); - } - $ret .= "<code>$display</code>\n"; - - $curIdent = $ident; + $ret .= "<li><code>$display</code></li>\n"; } - $ret .= str_repeat( '</li></ul>', $curIdent ) . "</li>\n</ul>\n"; + $ret .= '</ul>' . "\n"; return $ret; } -- To view, visit https://gerrit.wikimedia.org/r/242804 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ade132e04d745a21f4ec9fdd52a43b10d85e4d3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits