Last modified: 2010-05-15 15:41:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9424, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7424 - Bad Behavior extension called multiple times during page render
Bad Behavior extension called multiple times during page render
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: testme
Depends on:
  Show dependency treegraph
Reported: 2006-09-27 15:02 UTC by spambox
Modified: 2010-05-15 15:41 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description spambox 2006-09-27 15:02:47 UTC
I've reported this bug to the author of the Bad Behavior extension and he's
indicated that it only appears in 1.7.1 to his knowledge, and seems to be
related to the hook which calls Bad Behavior being called multiple times during
the generation of certain pages.

The symptoms are excessive whitespace in certain pages, particluarly
Special:Recentchanges and the edit page.  This is caused by spurious insertion
of <p> tags into the code.  Associated with insertions of whitespace or <p> tags
is a Bad Behavior runtime comment, indicating that the extension is being run
multiple times for certain page renders.  The comments are not always associated
with insertion of HTML elements which mess up the page, however.  Bad Behavior
comments appear at other places in the source without associated whitespace.

This behavior has been noted on two MediaWiki installations running 1.7.1 and
Bad Behavior 2.0.5 and 2.0.6.  They can be found at
and .  The author insists that the bug must be in
MediaWiki so I am reporting it here.
Comment 1 Brion Vibber 2006-09-27 16:05:08 UTC
Sounds like a bug in the extension, which we don't have and didn't write. It's 
probably making incorrect assumptions, and making incorrect output.
Comment 2 spambox 2006-10-10 22:49:31 UTC
Even though this bug is (currently) closed, I'd like to point out that the
function in Bad Behavior 2 which outputs the timing comments associated with the
spurious whitespace is called by hooking to ParserAfterTidy.  So my uneducated
guess is that there might be a problem with ParserAfterTidy.


$wgHooks['ParserAfterTidy'][] = 'bb2_mediawiki_timer';


function bb2_mediawiki_timer(&$parser, &$text) {
	global $bb2_timer_total;
	$text = "<!-- Bad Behavior " . BB2_VERSION . " run time: " . number_format(1000
* $bb2_timer_total, 3) . " ms -->\n" . $text;

It doesn't explain the apparent insertion of <p> tags, but this HTML comment is
being added multiple times within the rendered source of the page.
Comment 3 spambox 2006-10-10 22:53:10 UTC
Pardon my shotgun approach here, but see also and
Bug 1772.

Note You need to log in before you can comment on or make changes to this bug.