r44034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44033‎ | r44034 | r44035 >
Date:04:07, 29 November 2008
Author:mrzman
Status:ok (Comments)
Tags:
Comment:
Fix parsing of labeltext on the "search2" form, make sure labels are correctly associated with an input.
Modified paths:
  • /trunk/extensions/InputBox/InputBox.classes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InputBox/InputBox.classes.php
@@ -183,22 +183,10 @@
184184 $id = Sanitizer::escapeId( $this->mID );
185185 $htmlLabel = '';
186186 if ( isset( $this->mLabelText ) && strlen( trim( $this->mLabelText ) ) ) {
187 - $output = $this->mParser->parse(
188 - $this->mLabelText,
189 - $this->mParser->getTitle(),
190 - $this->mParser->getOptions(),
191 - false,
192 - false
193 - );
194 - $this->mLabelText = $output->getText();
195 - $this->mLabelText = str_replace( '<p>', '', $this->mLabelText );
196 - $this->mLabelText = str_replace( '</p>', '', $this->mLabelText );
197 - $htmlLabel = Xml::element( 'label',
198 - array(
199 - 'for' => 'bodySearchIput' . $id
200 - ),
201 - $this->mLabelText
202 - );
 187+ $this->mLabelText = $this->mParser->recursiveTagParse( $this->mLabelText );
 188+ $htmlLabel = Xml::openElement( 'label', array( 'for' => 'bodySearchInput' . $id ) );
 189+ $htmlLabel .= $this->mLabelText;
 190+ $htmlLabel .= Xml::closeElement( 'label' );
203191 }
204192 $htmlOut = Xml::openElement( 'form',
205193 array(
@@ -222,7 +210,7 @@
223211 'type' => $this->mHidden ? 'hidden' : 'text',
224212 'name' => 'search',
225213 'size' => $this->mWidth,
226 - 'class' => 'bodySearchInput' . $id
 214+ 'id' => 'bodySearchInput' . $id
227215 )
228216 );
229217 $htmlOut .= Xml::element( 'input',

Comments

#Comment by Mr.Z-man (talk | contribs)   04:09, 29 November 2008

Forgot to mention in commit message, this is bug 16473.

Status & tagging log