Page MenuHomePhabricator

on edit page wpMinorEdit and wpWatchThis labels malformed
Closed, ResolvedPublic

Description

Author: petrel.harp

Description:
There is malformed html in the 'label' tags for the minor edit and watchlist checkboxes on the Edit page. This causes rendering errors if served as XHTML.

The malformed code:

<label for='wpMinoredit' id='mw-editpage-minoredit'Mark this as a minor edit [i]>This is a minor edit</label>

<label for='wpWatchthis' id='mw-editpage-watch'Add this page to your watchlist [w]>Watch this page</label></div>

This occurs on lines 2355 and 2368 of EditPage.php; the following is put into the label tag:

$skin->titleAttrib( 'minoredit', 'withaccess' )

... and I have no idea why. The diff below removes this and fixes the bug.

Index: includes/EditPage.php

  • includes/EditPage.php (revision 78212)

+++ includes/EditPage.php (working copy)
@@ -2355,7 +2355,7 @@

);
$checkboxes['minor'] =
    Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
  • "&#160;<label for='wpMinoredit' id='mw-editpage-minoredit'" . $skin->titleAttrib( 'minoredit', 'withaccess' ) . ">{$minorLabel}</label>";

+ "&#160;<label for='wpMinoredit' id='mw-editpage-minoredit'>{$minorLabel}</label>";

}

$watchLabel = wfMsgExt( 'watchthis', array( 'parseinline' ) );

@@ -2368,7 +2368,7 @@

);
$checkboxes['watch'] =
    Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) .
  • "&#160;<label for='wpWatchthis' id='mw-editpage-watch'" . $skin->titleAttrib( 'watch', 'withaccess' ) . ">{$watchLabel}</label>";

+ "&#160;<label for='wpWatchthis' id='mw-editpage-watch'>{$watchLabel}</label>";

}
wfRunHooks( 'EditPageBeforeEditChecks', array( &$this, &$checkboxes, &$tabindex ) );
return $checkboxes;

Version: 1.18.x
Severity: normal

Details

Reference
bz26302

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:20 PM
bzimport set Reference to bz26302.
bzimport added a subscriber: Unknown Object (MLST).

r78264

Thanks for the report! :)