r14562 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14561‎ | r14562 | r14563 >
Date:01:47, 4 June 2006
Author:brion
Status:old
Tags:
Comment:
Fix bug 4785: <inputbox> in template breaks other extensions and nowikis in parent page
Modified paths:
  • /trunk/extensions/inputbox/inputbox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/inputbox/inputbox.php
@@ -45,7 +45,7 @@
4646 */
4747 function renderInputbox($input, $params, &$parser)
4848 {
49 - $inputbox=new Inputbox();
 49+ $inputbox=new Inputbox( $parser );
5050 getBoxOption($inputbox->type,$input,'type');
5151 getBoxOption($inputbox->width,$input,'width',true);
5252 getBoxOption($inputbox->preload,$input,'preload');
@@ -87,6 +87,10 @@
8888 var $type,$width,$preload,$editintro, $br;
8989 var $defaulttext,$bgcolor,$buttonlabel,$searchbuttonlabel;
9090
 91+ function InputBox( &$parser ) {
 92+ $this->parser =& $parser;
 93+ }
 94+
9195 function render() {
9296 if($this->type=='create' || $this->type=='comment') {
9397 return $this->getCreateForm();
@@ -167,7 +171,7 @@
168172 }
169173
170174 function getSearchForm2() {
171 - global $wgUser, $wgOut;
 175+ global $wgUser;
172176
173177 $sk=$wgUser->getSkin();
174178 $searchpath = $sk->escapeSearchLink();
@@ -175,7 +179,9 @@
176180 $this->buttonlabel = wfMsgHtml( 'tryexact' );
177181 }
178182
179 - $this->labeltext = $wgOut->parse( $this->labeltext, false );
 183+ $output = $this->parser->parse( $this->labeltext,
 184+ $this->parser->mTitle, $this->parser->mOptions, false, false );
 185+ $this->labeltext = $output->getText();
180186 $this->labeltext = str_replace('<p>', '', $this->labeltext);
181187 $this->labeltext = str_replace('</p>', '', $this->labeltext);
182188
@@ -183,7 +189,7 @@
184190 <form action="$searchpath" class="bodySearch" id="bodySearch{$this->id}"><div class="bodySearchWrap"><label for="bodySearchIput{$this->id}">{$this->labeltext}</label><input type="text" name="search" size="{$this->width}" class="bodySearchIput" id="bodySearchIput{$this->id}" /><input type="submit" name="go" value="{$this->buttonlabel}" class="bodySearchBtnGo" />
185191 ENDFORM;
186192
187 - if ( $this->fulltextbtn )
 193+ if ( !empty( $this->fulltextbtn ) ) // this is wrong...
188194 $searchform .= '<input type="submit" name="fulltext" class="bodySearchBtnSearch" value="{$this->searchbuttonlabel}" />';
189195
190196 $searchform .= '</div></form>';

Status & tagging log