Index: trunk/extensions/Contest/specials/SpecialContest.php |
— | — | @@ -130,6 +130,7 @@ |
131 | 131 | |
132 | 132 | if ( $challenge !== false ) { |
133 | 133 | $conds['contestant_challenge_id'] = $challenge->getField( 'id' ); |
| 134 | + unset( $conds['contestant_contest_id'] ); // Not needed because the challenge implies the context |
134 | 135 | } |
135 | 136 | } |
136 | 137 | |
Index: trunk/extensions/Contest/includes/ContestantPager.php |
— | — | @@ -190,18 +190,19 @@ |
191 | 191 | ); |
192 | 192 | break; |
193 | 193 | case 'contestant_volunteer': case 'contestant_wmf': |
194 | | - $value = wfMsg( 'contest-contestant-' . ( $value === '1' ? 'yes' : 'no' ) ); |
| 194 | + // contest-contestant-yes, contest-contestant-no |
| 195 | + $value = htmlspecialchars( wfMsg( 'contest-contestant-' . ( $value === '1' ? 'yes' : 'no' ) ) ); |
195 | 196 | break; |
196 | 197 | case 'contestant_comments': |
197 | | - $value = $this->getLang()->formatNum( $value ); |
| 198 | + $value = htmlspecialchars( $this->getLang()->formatNum( $value ) ); |
198 | 199 | break; |
199 | 200 | case 'contestant_rating': |
200 | | - $value = wfMsgExt( |
| 201 | + $value = htmlspecialchars( wfMsgExt( |
201 | 202 | 'contest-contestant-rating', |
202 | 203 | 'parsemag', |
203 | 204 | $this->getLang()->formatNum( $value ), |
204 | 205 | $this->getLang()->formatNum( $this->mCurrentRow->contestant_rating_count ) |
205 | | - ); |
| 206 | + ) ); |
206 | 207 | break; |
207 | 208 | } |
208 | 209 | |
Index: trunk/extensions/Contest/Contest.sql |
— | — | @@ -46,8 +46,19 @@ |
47 | 47 | contestant_comments SMALLINT unsigned NOT NULL -- The number of comments |
48 | 48 | ) /*$wgDBTableOptions*/; |
49 | 49 | -- TODO: probably need to split indexes, see queries in ContestantPager |
50 | | -CREATE INDEX /*i*/contest_contestants_interests ON /*_*/contest_contestants (contestant_challenge_id, contestant_wmf, contestant_volunteer); |
51 | | -CREATE INDEX /*i*/contest_contestants_rating ON /*_*/contest_contestants (contestant_challenge_id, contestant_rating, contestant_rating_count); |
| 50 | +CREATE INDEX /*i*/contest_contestants_contest_id ON /*_*/contest_contestants (contestant_contest_id, contestant_id); |
| 51 | +CREATE INDEX /*i*/contest_contestants_challenge_id ON /*_*/contest_contestants (contestant_challenge_id, contestant_id); |
| 52 | +CREATE INDEX /*i*/contest_contestants_contest_challenge ON /*_*/contest_contestants (contestant_contest_id, contestant_challenge_id); |
| 53 | +CREATE INDEX /*i*/contest_contestants_contest_volunteer ON /*_*/contest_contestants (contestant_contest_id, contestant_volunteer); |
| 54 | +CREATE INDEX /*i*/contest_contestants_challenge_volunteer ON /*_*/contest_contestants (contestant_challenge_id, contestant_volunteer); |
| 55 | +CREATE INDEX /*i*/contest_contestants_contest_wmf ON /*_*/contest_contestants (contestant_contest_id, contestant_wmf); |
| 56 | +CREATE INDEX /*i*/contest_contestants_challenge_wmf ON /*_*/contest_contestants (contestant_challenge_id, contestant_wmf); |
| 57 | +CREATE INDEX /*i*/contest_contestants_contest_comments ON /*_*/contest_contestants (contestant_contest_id, contestant_comments); |
| 58 | +CREATE INDEX /*i*/contest_contestants_challenge_comments ON /*_*/contest_contestants (contestant_challenge_id, contestant_comments); |
| 59 | +CREATE INDEX /*i*/contest_contestants_contest_rating ON /*_*/contest_contestants (contestant_contest_id, contestant_rating); |
| 60 | +CREATE INDEX /*i*/contest_contestants_challenge_rating ON /*_*/contest_contestants (contestant_challenge_id, contestant_rating); |
| 61 | +CREATE INDEX /*i*/contest_contestants_contest_rating_count ON /*_*/contest_contestants (contestant_contest_id, contestant_rating_count); |
| 62 | +CREATE INDEX /*i*/contest_contestants_challenge_rating_count ON /*_*/contest_contestants (contestant_challenge_id, contestant_rating_count); |
52 | 63 | CREATE UNIQUE INDEX /*i*/contest_contestants_id_user ON /*_*/contest_contestants (contestant_contest_id, contestant_user_id); |
53 | 64 | |
54 | 65 | -- Challenges |