r100379 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100378‎ | r100379 | r100380 >
Date:21:22, 20 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes (modified) (history)
  • /branches/REL1_18/phase3/includes/api (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryBase.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryBlocks.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryProtectedTitles.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryRevisions.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)
  • /branches/REL1_18/phase3/includes/parser/Parser.php (modified) (history)
  • /branches/REL1_18/phase3/includes/parser/ParserCache.php (modified) (history)
  • /branches/REL1_18/phase3/includes/parser/ParserOutput.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialBlockList.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialUnblock.php (modified) (history)
  • /branches/REL1_18/phase3/languages (modified) (history)
  • /branches/REL1_18/phase3/languages/Language.php (modified) (history)
  • /branches/REL1_18/phase3/languages/messages (modified) (history)
  • /branches/REL1_18/phase3/skins/Standard.php (modified) (history)

Diff [purge]

Property changes on: branches/REL1_18/phase3/languages/messages
___________________________________________________________________
Modified: svn:mergeinfo
11 Merged /trunk/phase3/languages/messages:r99396
Index: branches/REL1_18/phase3/languages/Language.php
@@ -3423,7 +3423,7 @@
34243424 : $infinity;
34253425 } else {
34263426 return $format === true
3427 - ? $this->timeanddate( $expiry, /* User preference timezome */ true )
 3427+ ? $this->timeanddate( $expiry, /* User preference timezone */ true )
34283428 : wfTimestamp( $format, $expiry );
34293429 }
34303430 }
Property changes on: branches/REL1_18/phase3/languages
___________________________________________________________________
Modified: svn:mergeinfo
34313431 Merged /trunk/phase3/languages:r99135-99136,99138,99154,99172,99250,99252,99254,99318,99396
Index: branches/REL1_18/phase3/skins/Standard.php
@@ -107,10 +107,10 @@
108108
109109 $barnumber = 1;
110110 foreach ( $bar as $browseLinks ) {
111 - if ( $barnumber > 1 ) {
112 - $s .= "\n<hr class='sep' />";
113 - }
114111 if ( is_array( $browseLinks ) ) {
 112+ if ( $barnumber > 1 ) {
 113+ $s .= "\n<hr class='sep' />";
 114+ }
115115 foreach ( $browseLinks as $link ) {
116116 if ( $link['text'] != '-' ) {
117117 $s .= "<a href=\"{$link['href']}\">" .
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
118118 Merged /trunk/phase3/RELEASE-NOTES-1.18:r99135-99136,99138
Index: branches/REL1_18/phase3/includes/parser/ParserOutput.php
@@ -155,6 +155,8 @@
156156 if ( $this->mEditSectionTokens ) {
157157 return preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
158158 array( &$this, 'replaceEditSectionLinksCallback' ), $this->mText );
 159+ } else {
 160+ return preg_replace( ParserOutput::EDITSECTION_REGEX, '', $this->mText );
159161 }
160162 return $this->mText;
161163 }
Index: branches/REL1_18/phase3/includes/parser/ParserCache.php
@@ -174,6 +174,11 @@
175175 }
176176
177177 wfDebug( "Found.\n" );
 178+
 179+ // The edit section preference may not be the appropiate one in
 180+ // the ParserOutput, as we are not storing it in the parsercache
 181+ // key. Force it here. See bug 31445.
 182+ $value->setEditSectionTokens( $popts->getEditSection() );
178183
179184 if ( !$useOutdated && $value->expired( $touched ) ) {
180185 wfIncrStats( "pcache_miss_expired" );
Index: branches/REL1_18/phase3/includes/parser/Parser.php
@@ -4017,7 +4017,7 @@
40184018 );
40194019
40204020 # give headline the correct <h#> tag
4021 - if ( $showEditLink && $sectionIndex !== false ) {
 4021+ if ( $sectionIndex !== false ) {
40224022 // Output edit section links as markers with styles that can be customized by skins
40234023 if ( $isTemplate ) {
40244024 # Put a T flag in the section identifier, to indicate to extractSections()
Index: branches/REL1_18/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -191,7 +191,7 @@
192192 $this->addWhereRange( 'ar_namespace', $dir, null, null );
193193 $this->addWhereRange( 'ar_title', $dir, null, null );
194194 }
195 - $this->addWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
 195+ $this->addTimestampWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
196196 }
197197 $res = $this->select( __METHOD__ );
198198 $pageMap = array(); // Maps ns&title to (fake) pageid
Index: branches/REL1_18/phase3/includes/api/ApiQueryBase.php
@@ -220,6 +220,16 @@
221221 }
222222 }
223223 }
 224+ /**
 225+ * Add a WHERE clause corresponding to a range, similar to addWhereRange,
 226+ * but converts $start and $end to database timestamps.
 227+ * @see addWhereRange
 228+ */
 229+ protected function addTimestampWhereRange( $field, $dir, $start, $end, $sort = true ) {
 230+ $db = $this->getDb();
 231+ return $this->addWhereRange( $field, $dir,
 232+ $db->timestamp( $start ), $db->timestamp( $end ), $sort );
 233+ }
224234
225235 /**
226236 * Add an option such as LIMIT or USE INDEX. If an option was set
Index: branches/REL1_18/phase3/includes/api/ApiQueryBlocks.php
@@ -81,7 +81,7 @@
8282 $fld_flags );
8383
8484 $this->addOption( 'LIMIT', $params['limit'] + 1 );
85 - $this->addWhereRange( 'ipb_timestamp', $params['dir'], $params['start'], $params['end'] );
 85+ $this->addTimestampWhereRange( 'ipb_timestamp', $params['dir'], $params['start'], $params['end'] );
8686 if ( isset( $params['ids'] ) ) {
8787 $this->addWhereFld( 'ipb_id', $params['ids'] );
8888 }
Index: branches/REL1_18/phase3/includes/api/ApiQueryLogEvents.php
@@ -116,7 +116,7 @@
117117 $index['logging'] = 'type_time';
118118 }
119119
120 - $this->addWhereRange( 'log_timestamp', $params['dir'], $params['start'], $params['end'] );
 120+ $this->addTimestampWhereRange( 'log_timestamp', $params['dir'], $params['start'], $params['end'] );
121121
122122 $limit = $params['limit'];
123123 $this->addOption( 'LIMIT', $limit + 1 );
Index: branches/REL1_18/phase3/includes/api/ApiQueryProtectedTitles.php
@@ -64,7 +64,7 @@
6565 $this->addFieldsIf( 'pt_expiry', isset( $prop['expiry'] ) );
6666 $this->addFieldsIf( 'pt_create_perm', isset( $prop['level'] ) );
6767
68 - $this->addWhereRange( 'pt_timestamp', $params['dir'], $params['start'], $params['end'] );
 68+ $this->addTimestampWhereRange( 'pt_timestamp', $params['dir'], $params['start'], $params['end'] );
6969 $this->addWhereFld( 'pt_namespace', $params['namespace'] );
7070 $this->addWhereFld( 'pt_create_perm', $params['level'] );
7171
Index: branches/REL1_18/phase3/includes/api/ApiQueryWatchlist.php
@@ -134,9 +134,8 @@
135135
136136 $db = $this->getDB();
137137
138 - $this->addWhereRange( 'rc_timestamp', $params['dir'],
139 - $db->timestamp( $params['start'] ),
140 - $db->timestamp( $params['end'] ) );
 138+ $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'],
 139+ $params['start'], $params['end'] );
141140 $this->addWhereFld( 'wl_namespace', $params['namespace'] );
142141
143142 if ( !$params['allrev'] ) {
Index: branches/REL1_18/phase3/includes/api/ApiQueryRevisions.php
@@ -252,14 +252,14 @@
253253 // one row with the same timestamp for the same page.
254254 // The order needs to be the same as start parameter to avoid SQL filesort.
255255 if ( is_null( $params['startid'] ) && is_null( $params['endid'] ) ) {
256 - $this->addWhereRange( 'rev_timestamp', $params['dir'],
 256+ $this->addTimestampWhereRange( 'rev_timestamp', $params['dir'],
257257 $params['start'], $params['end'] );
258258 } else {
259259 $this->addWhereRange( 'rev_id', $params['dir'],
260260 $params['startid'], $params['endid'] );
261261 // One of start and end can be set
262262 // If neither is set, this does nothing
263 - $this->addWhereRange( 'rev_timestamp', $params['dir'],
 263+ $this->addTimestampWhereRange( 'rev_timestamp', $params['dir'],
264264 $params['start'], $params['end'], false );
265265 }
266266
Index: branches/REL1_18/phase3/includes/api/ApiQueryUserContributions.php
@@ -182,7 +182,7 @@
183183 if ( $this->multiUserMode ) {
184184 $this->addWhereRange( 'rev_user_text', $this->params['dir'], null, null );
185185 }
186 - $this->addWhereRange( 'rev_timestamp',
 186+ $this->addTimestampWhereRange( 'rev_timestamp',
187187 $this->params['dir'], $this->params['start'], $this->params['end'] );
188188 $this->addWhereFld( 'page_namespace', $this->params['namespace'] );
189189
Index: branches/REL1_18/phase3/includes/api/ApiQueryRecentChanges.php
@@ -140,7 +140,7 @@
141141 */
142142 $this->addTables( 'recentchanges' );
143143 $index = array( 'recentchanges' => 'rc_timestamp' ); // May change
144 - $this->addWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
 144+ $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
145145 $this->addWhereFld( 'rc_namespace', $params['namespace'] );
146146 $this->addWhereFld( 'rc_deleted', 0 );
147147
Property changes on: branches/REL1_18/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
148148 Merged /trunk/phase3/includes/api:r99135-99136,99138
Index: branches/REL1_18/phase3/includes/specials/SpecialUnblock.php
@@ -191,11 +191,17 @@
192192 RevisionDeleteUser::unsuppressUserName( $block->getTarget(), $id );
193193 }
194194
 195+ # Redact the name (IP address) for autoblocks
 196+ if ( $block->getType() == Block::TYPE_AUTO ) {
 197+ $page = Title::makeTitle( NS_USER, '#' . $block->getId() );
 198+ } else {
 199+ $page = $block->getTarget() instanceof User
 200+ ? $block->getTarget()->getUserpage()
 201+ : Title::makeTitle( NS_USER, $block->getTarget() );
 202+ }
 203+
195204 # Make log entry
196205 $log = new LogPage( 'block' );
197 - $page = $block->getTarget() instanceof User
198 - ? $block->getTarget()->getUserpage()
199 - : Title::makeTitle( NS_USER, $block->getTarget() );
200206 $log->addEntry( 'unblock', $page, $data['Reason'] );
201207
202208 return true;
Index: branches/REL1_18/phase3/includes/specials/SpecialBlockList.php
@@ -244,7 +244,7 @@
245245
246246 switch( $name ) {
247247 case 'ipb_timestamp':
248 - $formatted = $this->getLang()->timeanddate( $value, /* User preference timezome */ true );
 248+ $formatted = $this->getLang()->timeanddate( $value, /* User preference timezone */ true );
249249 break;
250250
251251 case 'ipb_target':
@@ -270,7 +270,7 @@
271271 break;
272272
273273 case 'ipb_expiry':
274 - $formatted = $this->getLang()->formatExpiry( $value, /* User preference timezome */ true );
 274+ $formatted = $this->getLang()->formatExpiry( $value, /* User preference timezone */ true );
275275 if( $this->getUser()->isAllowed( 'block' ) ){
276276 if( $row->ipb_auto ){
277277 $links[] = $sk->linkKnown(
Property changes on: branches/REL1_18/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
278278 Merged /trunk/phase3/includes/specials:r99135-99136,99138,99172,99250,99252,99254,99318
Property changes on: branches/REL1_18/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
279279 Merged /trunk/phase3/includes:r99135-99136,99138,99172,99250,99252,99254,99318
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
280280 Merged /trunk/phase3:r99135-99136,99138,99154,99172,99250,99252,99254,99318,99353,99396

Follow-up revisions

RevisionCommit summaryAuthorDate
r100380After r100379, move release notes for bug 29392reedy21:22, 20 October 2011
r100404Commit release notes for r100379, looks like I didn't press savereedy03:13, 21 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99135(bug 24781) The API will include an XML namespace if the includexmlnamespace ...btongminh20:11, 6 October 2011
r99136Fix stupid typo in r99082. Thanks to Niklas for CRraymond20:19, 6 October 2011
r99138(bug 29392) Setting the start or end parameter now works with lists blocks, c...btongminh20:46, 6 October 2011
r99154* (bug 31352) Fix regression causing relative block times in log display to r...brion22:20, 6 October 2011
r99172Redact IP address when unblocking autoblocksaaron00:38, 7 October 2011
r99250Bug 31445: "Section edit links do not show"...platonides20:50, 7 October 2011
r99252Forgot to commit this file in r99250.platonides21:00, 7 October 2011
r99254We don't need anything from the marker. The title is outside.platonides21:05, 7 October 2011
r99353Fix bug 31436....hartman15:35, 9 October 2011
r99396Remove configuration specific "As an administrator" from 8 messages. Spotted ...siebrand10:14, 10 October 2011

Status & tagging log