(bug 40889) Fix XHTML in Special:Upload form labels
authorMark Holmquist <mtraceur@member.fsf.org>
Sat, 13 Oct 2012 23:33:50 +0000 (16:33 -0700)
committerMark Holmquist <mtraceur@member.fsf.org>
Sat, 13 Oct 2012 23:33:50 +0000 (16:33 -0700)
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

index a061963..e3a4c3a 100644 (file)
@@ -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'] ) ) {