r81079 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81078‎ | r81079 | r81080 >
Date:01:15, 27 January 2011
Author:catrope
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_17/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)
  • /branches/REL1_17/extensions/CentralAuth/SpecialWikiSets.php (modified) (history)
  • /branches/REL1_17/extensions/CodeReview/archives/code_signoffs.sql (modified) (history)
  • /branches/REL1_17/extensions/CodeReview/backend/CodePropChange.php (modified) (history)
  • /branches/REL1_17/extensions/CodeReview/backend/CodeRevision.php (modified) (history)
  • /branches/REL1_17/extensions/CodeReview/ui/CodeRevisionCommitter.php (modified) (history)
  • /branches/REL1_17/extensions/OAI/OAIRepo_body.php (modified) (history)
  • /branches/REL1_17/phase3/includes/ImportXMLReader.php (modified) (history)
  • /branches/REL1_17/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /branches/REL1_17/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/extensions/CodeReview/archives/code_signoffs.sql
@@ -12,7 +12,10 @@
1313 cs_flag varchar(25) not null,
1414
1515 -- Timestamp of the sign-off
16 - cs_timestamp binary(14) not null default ''
 16+ cs_timestamp binary(14) not null default '',
 17+
 18+ -- Timestamp the sign-off was struck, or Block::infinity() if not struck
 19+ cs_timestamp_struck varbinary(14) not null default 'infinity'
1720 ) /*$wgDBTableOptions*/;
18 -CREATE UNIQUE INDEX /*i*/cs_repo_rev_user_flag ON /*_*/code_signoffs (cs_repo_id, cs_rev_id, cs_user_text, cs_flag);
 21+CREATE UNIQUE INDEX /*i*/cs_repo_rev_user_flag_tstruck ON /*_*/code_signoffs (cs_repo_id, cs_rev_id, cs_user_text, cs_flag, cs_timestamp_struck);
1922 CREATE INDEX /*i*/cs_repo_repo_rev_timestamp ON /*_*/code_signoffs (cs_repo_id, cs_rev_id, cs_timestamp);
Index: branches/REL1_17/extensions/CodeReview/backend/CodeRevision.php
@@ -445,7 +445,7 @@
446446 // Give email notices to committer and commenters
447447 global $wgCodeReviewENotif, $wgEnableEmail, $wgCodeReviewCommentWatcherEmail,
448448 $wgCodeReviewCommentWatcherName, $wgUser;
449 - if ( !$wgCodeReviewENotif && !$wgEnableEmail ) {
 449+ if ( !$wgCodeReviewENotif || !$wgEnableEmail ) {
450450 return;
451451 }
452452
Index: branches/REL1_17/extensions/CodeReview/backend/CodePropChange.php
@@ -10,7 +10,7 @@
1111 }
1212
1313 static function newFromData( $rev, $data ) {
14 - $change = new CodeComment( $rev );
 14+ $change = new CodePropChange( $rev );
1515 $change->attrib = $data['cpc_attrib'];
1616 $change->removed = $data['cpc_removed'];
1717 $change->added = $data['cpc_added'];
Index: branches/REL1_17/extensions/CodeReview/ui/CodeRevisionCommitter.php
@@ -104,7 +104,7 @@
105105 if ( count( $removeReferences ) && $this->validPost( 'codereview-associate' ) ) {
106106 $this->mRev->removeReferencesFrom( $removeReferences );
107107 }
108 -
 108+
109109 // Add any comments
110110 $commentAdded = false;
111111 $commentId = 0;
@@ -112,7 +112,7 @@
113113 // $isPreview = $wgRequest->getCheck( 'wpPreview' );
114114 $commentId = $this->mRev->saveComment( $commentText, $review, $parent );
115115
116 - $commentAdded = ($commentId !== 0);
 116+ $commentAdded = ($commentId !== 0);
117117 }
118118 $dbw->commit();
119119
@@ -133,8 +133,8 @@
134134 $wgUser->getName(), $url, $this->mRev->getIdStringUnique(), $this->text
135135 );
136136 }
137 - }
 137+ }
138138
139 - return $commentId;
 139+ return $commentId;
140140 }
141141 }
Index: branches/REL1_17/extensions/OAI/OAIRepo_body.php
@@ -877,7 +877,7 @@
878878 array( 'img_name' => $this->_row->page_title ),
879879 $fname );
880880 if( $imageRow ) {
881 - $url = Image::imageUrl( $imageRow->img_name );
 881+ $url = wfFindFile( $imageRow->img_name )->getUrl();
882882
883883 if( $url{0} == '/' ) {
884884 global $wgServer;
Index: branches/REL1_17/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -427,6 +427,7 @@
428428 'cl_from' );
429429 $where = array();
430430 $joins = array();
 431+ $options = array( 'ORDER BY' => 'cl_type, cl_sortkey', 'LIMIT' => $wgCategoryTreeMaxChildren );
431432
432433 if ( $inverse ) {
433434 $joins['categorylinks'] = array( 'RIGHT JOIN', 'cl_to = page_title AND page_namespace = ' . NS_CATEGORY );
@@ -434,6 +435,7 @@
435436 } else {
436437 $joins['categorylinks'] = array( 'JOIN', 'cl_from = page_id' );
437438 $where['cl_to'] = $title->getDBkey();
 439+ $options['USE INDEX']['categorylinks'] = 'cl_sortkey';
438440
439441 # namespace filter.
440442 if ( $namespaces ) {
@@ -457,9 +459,7 @@
458460 $joins['category'] = array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY );
459461 }
460462
461 - $res = $dbr->select( $tables, $fields, $where, __METHOD__,
462 - array( 'ORDER BY' => 'cl_type, cl_sortkey', 'LIMIT' => $wgCategoryTreeMaxChildren ),
463 - $joins );
 463+ $res = $dbr->select( $tables, $fields, $where, __METHOD__, $options, $joins );
464464
465465 # collect categories separately from other pages
466466 $categories = '';
Property changes on: branches/REL1_17/extensions/CategoryTree/CategoryTreeFunctions.php
___________________________________________________________________
Modified: svn:mergeinfo
467467 Merged /trunk/extensions/CategoryTree/CategoryTreeFunctions.php:r80634
Index: branches/REL1_17/extensions/CentralAuth/SpecialWikiSets.php
@@ -166,7 +166,8 @@
167167 sort( $list );
168168 $html = '<ul>';
169169 foreach ( $list as $wiki ) {
170 - $html .= "<li>{$wiki}</li>";
 170+ $escWiki = htmlspecialchars( $wiki );
 171+ $html .= "<li>{$escWiki}</li>";
171172 }
172173 $html .= '</ul>';
173174 return $html;
Index: branches/REL1_17/phase3/includes/ImportXMLReader.php
@@ -548,7 +548,7 @@
549549 $tag = $this->reader->name;
550550
551551 if ( !wfRunHooks( 'ImportHandleUploadXMLTag', $this->reader,
552 - $pageInfo, $revisionInfo ) ) {
 552+ $pageInfo ) ) {
553553 // Do nothing
554554 } elseif ( in_array( $tag, $normalFields ) ) {
555555 $uploadInfo[$tag] = $this->nodeContents();
Property changes on: branches/REL1_17/phase3/includes/ImportXMLReader.php
___________________________________________________________________
Modified: svn:mergeinfo
556556 Merged /trunk/phase3/includes/ImportXMLReader.php:r80507
Index: branches/REL1_17/phase3/includes/specials/SpecialContributions.php
@@ -666,7 +666,7 @@
667667 array( 'oldid' => intval( $row->rev_id ) )
668668 );
669669 } else {
670 - $d = $date;
 670+ $d = htmlspecialchars( $date );
671671 }
672672 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
673673 $d = '<span class="history-deleted">' . $d . '</span>';
Index: branches/REL1_17/phase3/languages/LanguageConverter.php
@@ -308,14 +308,23 @@
309309 * @return String like ' alt="yyyy"' or ' title="yyyy"'
310310 */
311311 protected function captionConvert( $matches ) {
 312+ // TODO: cache the preferred variant in every autoConvert() process,
 313+ // this helps improve performance in a way.
312314 $toVariant = $this->getPreferredVariant();
313315 $title = $matches[1];
314 - $text = $matches[2];
 316+ $text = $matches[2];
 317+
315318 // we convert captions except URL
316319 if ( !strpos( $text, '://' ) ) {
317320 $text = $this->translate( $text, $toVariant );
318321 }
319 - return " $title=\"$text\"";
 322+
 323+ // remove HTML tags to prevent disrupting the layout
 324+ $text = preg_replace( '/<[^>]+>/', '', $text );
 325+ // escape HTML special chars to prevent disrupting the layout
 326+ $text = htmlspecialchars( $text );
 327+
 328+ return " {$title}=\"{$text}\"";
320329 }
321330
322331 /**
Property changes on: branches/REL1_17/phase3/languages/LanguageConverter.php
___________________________________________________________________
Modified: svn:mergeinfo
323332 Merged /trunk/phase3/languages/LanguageConverter.php:r80978

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80507Fix r66267, make hook code consistent with documentation, fix E_NOTICEwerdna18:33, 18 January 2011
r80634CategoryTree: Force cl_sortkey index. This is a backport of the live hack com...catrope18:55, 20 January 2011
r80770Fixup deprecated method call fixme on r69995reedy21:09, 22 January 2011
r80961Fixup whitespace issues from r75319...reedy08:28, 25 January 2011
r80978LanguageConverter::captionConvert(): remove HTML tags and escape HTML special...philip18:33, 25 January 2011
r80985Followup r75319, swap && for ||, only care about one being false to short cir...reedy20:10, 25 January 2011
r81042Escape the output of $wgLang->timeanddate() in SpecialContributions. Was esca...catrope17:59, 26 January 2011
r81060CodeReview: Update code_signoff.sql for r77302 (cs_timestamp_struck) so the e...catrope22:25, 26 January 2011
r81065Followup r63808: escape wiki name with htmlspecialcharscatrope23:07, 26 January 2011
r81068Followup r43465, CodePropChange won't create a CodeComment instancereedy23:18, 26 January 2011

Status & tagging log