r52979 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52978‎ | r52979 | r52980 >
Date:13:57, 9 July 2009
Author:jan
Status:deferred
Tags:
Comment:
Bugfixes for Poll extension
Modified paths:
  • /trunk/extensions/Poll/Poll.i18n.php (modified) (history)
  • /trunk/extensions/Poll/Poll_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Poll/Poll_body.php
@@ -150,7 +150,7 @@
151151 if($alternative_4 != "") { $wgOut->addHtml( '<tr><td>'.Xml::radio('vote', '4').' '.$alternative_4.'</td></tr>' ); }
152152 if($alternative_5 != "") { $wgOut->addHtml( '<tr><td>'.Xml::radio('vote', '5').' '.$alternative_5.'</td></tr>' ); }
153153 if($alternative_6 != "") { $wgOut->addHtml( '<tr><td>'.Xml::radio('vote', '6').' '.$alternative_6.'</td></tr>' ); }
154 - $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-vote-other' ).'</td><td>'.Xml::input('vote_other').'</td></tr>' );
 154+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-vote-other' ).' '.Xml::input('vote_other').'</td></tr>' );
155155 }
156156 if( $multi == 1 ) {
157157 $wgOut->addHtml( '<tr><td>'.Xml::check('vote_1').' '.$alternative_1.'</td></tr>' );
@@ -158,9 +158,10 @@
159159 if($alternative_3 != "") { $wgOut->addHtml( '<tr><td>'.Xml::check('vote_3').' '.$alternative_3.'</td></tr>' ); }
160160 if($alternative_4 != "") { $wgOut->addHtml( '<tr><td>'.Xml::check('vote_4').' '.$alternative_4.'</td></tr>' ); }
161161 if($alternative_5 != "") { $wgOut->addHtml( '<tr><td>'.Xml::check('vote_5').' '.$alternative_5.'</td></tr>' ); }
162 - if($alternative_6 != "") { $wgOut->addHtml( '<tr><td>'.Xml::check('vote_6').' '.$alternative_6.'</td></tr>' ); }
 162+ if($alternative_6 != "") { $wgOut->addHtml( '<tr><td>'.Xml::check('vote_6').' '.$alternative_6.'</td></tr>' ); }
 163+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-vote-other' ).' '.Xml::input('vote_other').'</td></tr>' );
163164 }
164 - $wgOut->addHtml( '<tr><td>'.Xml::submitButton(wfMsg( 'poll-submit' )).''.Xml::hidden('type', 'vote').''.Xml::hidden('multi', $multi).'</td><td><a href="'.$this->getTitle()->getFullURL( 'action=score&id='.$vid ).'">'.wfMsg( 'poll-title-score' ).'</a></td></tr>' );
 165+ $wgOut->addHtml( '<tr><td>'.Xml::submitButton(wfMsg( 'poll-submit' )).''.Xml::hidden('type', 'vote').''.Xml::hidden('multi', $multi).' <a href="'.$this->getTitle()->getFullURL( 'action=score&id='.$vid ).'">'.wfMsg( 'poll-title-score' ).'</a></td></tr>' );
165166 $wgOut->addHtml( '<tr><td>' );
166167 $wgOut->addWikiText( '<small>'.wfMsg( 'poll-score-created', $creater ).'</small>' );
167168 $wgOut->addHtml( '</td></tr>' );
@@ -249,7 +250,7 @@
250251 }
251252 $score_other_out = "";
252253 foreach($score_other as $name => $value) {
253 - $score_other_out .= '<tr><td>'.$name.'</td><td>'.$value['number'].'</td></tr>';
 254+ $score_other_out .= '<tr><td>'.htmlentities( $name, ENT_QUOTES, 'UTF-8' ).'</td><td>'.htmlentities( $value['number'], ENT_QUOTES, 'UTF-8' ).'</td></tr>';
254255 }
255256
256257 $wgOut->addHtml( Xml::openElement( 'table' ) );
@@ -260,7 +261,7 @@
261262 if($alternative_4 != "") { $wgOut->addHtml( '<tr><td>'.$alternative_4.'</td><td>'.$query_num_4.'</td></tr>' ); }
262263 if($alternative_5 != "") { $wgOut->addHtml( '<tr><td>'.$alternative_5.'</td><td>'.$query_num_5.'</td></tr>' ); }
263264 if($alternative_6 != "") { $wgOut->addHtml( '<tr><td>'.$alternative_6.'</td><td>'.$query_num_6.'</td></tr>' ); }
264 - if($score_other_out != "") { $wgOut->addHtml( '<tr><td colspan="2">'.wfMsg( 'poll-vote-other' ).'</td></tr>'. $score_other_out ); }
 265+ if($score_other_out != "") { $wgOut->addHtml( '<tr><td colspan="2">'.wfMsg( 'poll-vote-other' ).' </td></tr>'. $score_other_out ); }
265266 $wgOut->addHtml( '<tr><td>' );
266267 $wgOut->addWikiText( '<small>'.wfMsg( 'poll-score-created', $creater ).'</small>' );
267268 $wgOut->addHtml( '</td></tr>' );
Index: trunk/extensions/Poll/Poll.i18n.php
@@ -57,7 +57,7 @@
5858 'poll-no-dis' => 'No Description!',
5959 'poll-create-allow-more' => 'Allow Multi-Vote',
6060 'poll-vote-changed' => 'Vote has been changed!',
61 - 'poll-vote-other' => 'Other answers: ',
 61+ 'poll-vote-other' => 'Other answers:',
6262 'poll-ip-error' => 'Unregistered person can not vote at this poll!',
6363 'poll-create-allow-ip' => 'Allow unregistered users to vote',
6464 );
@@ -111,7 +111,7 @@
112112 'poll-no-dis' => 'Keine Beschreibung vorhanden!',
113113 'poll-create-allow-more' => 'Mehfachabstimmung erlaubt',
114114 'poll-vote-changed' => 'Stimme wurde geändert!',
115 - 'poll-vote-other' => 'Andere Antworten: ',
116 - 'poll-ip-error' => 'Nicht regestrierte Benutzer können bei dieser Umfrage nicht abstimmen!',
 115+ 'poll-vote-other' => 'Andere Antworten:',
 116+ 'poll-ip-error' => 'Nicht registrierte Benutzer können bei dieser Umfrage nicht abstimmen!',
117117 'poll-create-allow-ip' => 'Erlaube nicht registrierten Benutzer abzustimmen',
118118 );

Status & tagging log