From 6f1d4db3e1e2bba4f204b44ee10cc8f87a2e1238 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Sat, 13 Oct 2012 16:33:50 -0700 Subject: [PATCH] (bug 40889) Fix XHTML in Special:Upload form labels We were using an improper method for adding labels to the form, namely using something other than the ID (and in fact, a nonexistent ID) in the 'for' attribute. This patch uses the ID of the parent element and should fix the issue. Note: Upstream bug in Firefox prevents testing this patch in that browser. Use Chromium, as the FF bug report says that it works there. See https://bugzilla.mozilla.org/show_bug.cgi?id=701353 for more. Change-Id: I19e06a3b94f67f364d129cbef4ecc232f108e82d --- includes/specials/SpecialUpload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index a061963d1e..e3a4c3abeb 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -1107,7 +1107,7 @@ class UploadSourceField extends HTMLTextField { * @return string */ function getLabelHtml( $cellAttributes = array() ) { - $id = "wpSourceType{$this->mParams['upload-type']}"; + $id = $this->mParams['id']; $label = Html::rawElement( 'label', array( 'for' => $id ), $this->mLabel ); if ( !empty( $this->mParams['radio'] ) ) { -- 2.20.1