| Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
| — | — | @@ -360,7 +360,7 @@ |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | //Notify commenters and revision author of followup revision |
| 364 | | - foreach ( $users as $userId => $user ) { |
| | 364 | + foreach ( $users as $user ) { |
| 365 | 365 | // Notify user with its own message if he already want |
| 366 | 366 | // to be CCed of all emails it sends. |
| 367 | 367 | if ( $commitAuthorId == $user->getId() ) { |
| Index: trunk/extensions/CodeReview/svnImport.php |
| — | — | @@ -141,7 +141,7 @@ |
| 142 | 142 | __METHOD__, |
| 143 | 143 | $options |
| 144 | 144 | ); |
| 145 | | - while ( $row = $dbw->fetchObject( $res ) ) { |
| | 145 | + foreach ( $res as $row ) { |
| 146 | 146 | $repo->getRevision( $row->cr_id ); |
| 147 | 147 | $repo->getDiff( $row->cr_id ); // trigger caching |
| 148 | 148 | $this->output( "Diff r{$row->cr_id} done\n" ); |
| Index: trunk/extensions/CodeReview/api/ApiCodeRevisions.php |
| — | — | @@ -31,7 +31,7 @@ |
| 32 | 32 | |
| 33 | 33 | public function execute() { |
| 34 | 34 | global $wgUser; |
| 35 | | - $this->getMain()->setVaryCookie(); |
| | 35 | + $this->getMain()->setCacheMode( 'anon-public-user-private' ); |
| 36 | 36 | // Before doing anything at all, let's check permissions |
| 37 | 37 | if ( !$wgUser->isAllowed( 'codereview-use' ) ) { |
| 38 | 38 | $this->dieUsage( 'You don\'t have permission to view code revisions', 'permissiondenied' ); |
| Index: trunk/extensions/CodeReview/ui/SpecialRepoAdmin.php |
| — | — | @@ -37,7 +37,7 @@ |
| 38 | 38 | global $wgScript; |
| 39 | 39 | return Xml::fieldset( wfMsg( 'repoadmin-new-legend' ) ) . |
| 40 | 40 | Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . |
| 41 | | - Xml::hidden( 'title', $this->mPage->getTitle()->getPrefixedDBKey() ) . |
| | 41 | + Html::hidden( 'title', $this->mPage->getTitle()->getPrefixedDBKey() ) . |
| 42 | 42 | Xml::inputLabel( wfMsg( 'repoadmin-new-label' ), 'repo', 'repo' ) . |
| 43 | 43 | Xml::submitButton( wfMsg( 'repoadmin-new-button' ) ) . |
| 44 | 44 | '</form></fieldset>'; |
| — | — | @@ -114,7 +114,7 @@ |
| 115 | 115 | Xml::input( 'wpBugPath', 60, $bugPath ), |
| 116 | 116 | 'repoadmin-edit-view' => |
| 117 | 117 | Xml::input( 'wpViewPath', 60, $viewPath ) ) ) . |
| 118 | | - Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->mRepoName ) ) . |
| | 118 | + Html::hidden( 'wpEditToken', $wgUser->editToken( $this->mRepoName ) ) . |
| 119 | 119 | Xml::submitButton( wfMsg( 'repoadmin-edit-button' ) ) . |
| 120 | 120 | '</form></fieldset>' |
| 121 | 121 | ); |
| Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
| — | — | @@ -71,7 +71,7 @@ |
| 72 | 72 | $dbr = wfGetDB( DB_SLAVE ); |
| 73 | 73 | $revObjects = array(); |
| 74 | 74 | $res = $dbr->select( 'code_rev', '*', array( 'cr_id' => $revisions, 'cr_repo_id' => $this->mRepo->getId() ), __METHOD__ ); |
| 75 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| | 75 | + foreach ($res as $row ) { |
| 76 | 76 | $revObjects[] = CodeRevision::newFromRow( $this->mRepo, $row ); |
| 77 | 77 | } |
| 78 | 78 | |
| — | — | @@ -81,14 +81,14 @@ |
| 82 | 82 | $addTags = array_map( 'trim', explode( ",", $addTags ) ); |
| 83 | 83 | $removeTags = array_map( 'trim', explode( ",", $removeTags ) ); |
| 84 | 84 | |
| 85 | | - foreach ( $revObjects as $id => $rev ) { |
| | 85 | + foreach ( $revObjects as $rev ) { |
| 86 | 86 | $rev->changeTags( $addTags, $removeTags, $wgUser ); |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if ( $wgUser->isAllowed( 'codereview-set-status' ) && |
| 91 | 91 | $revObjects && $revObjects[0]->isValidStatus( $status ) ) { |
| 92 | | - foreach ( $revObjects as $id => $rev ) { |
| | 92 | + foreach ( $revObjects as $rev ) { |
| 93 | 93 | $rev->setStatus( $status, $wgUser ); |
| 94 | 94 | } |
| 95 | 95 | } |
| — | — | @@ -160,10 +160,10 @@ |
| 161 | 161 | Xml::span( $this->mAppliedFilter, '' ) . '</strong> ' . |
| 162 | 162 | Xml::submitButton( wfMsg( 'code-revfilter-clear' ) ) . |
| 163 | 163 | '</td>' . |
| 164 | | - Xml::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) ) |
| | 164 | + Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) ) |
| 165 | 165 | ); |
| 166 | 166 | } else { |
| 167 | | - $wgOut->addHTML( Xml::hidden( 'title', $special->getPrefixedDBKey() ) ); |
| | 167 | + $wgOut->addHTML( Html::hidden( 'title', $special->getPrefixedDBKey() ) ); |
| 168 | 168 | } |
| 169 | 169 | $wgOut->addHTML( "</tr></table></fieldset>" . Xml::closeElement( 'form' ) ); |
| 170 | 170 | } |
| Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php |
| — | — | @@ -44,7 +44,7 @@ |
| 45 | 45 | $wgOut->addHTML( |
| 46 | 46 | Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) . |
| 47 | 47 | "<fieldset><legend>" . wfMsgHtml( 'code-release-legend' ) . "</legend>" . |
| 48 | | - Xml::hidden( 'title', $special->getPrefixedDBKey() ) . '<b>' . |
| | 48 | + Html::hidden( 'title', $special->getPrefixedDBKey() ) . '<b>' . |
| 49 | 49 | Xml::inputlabel( wfMsg( "code-release-startrev" ), 'startrev', 'startrev', 10, $this->mStartRev ) . |
| 50 | 50 | '</b> ' . |
| 51 | 51 | Xml::inputlabel( wfMsg( "code-release-endrev" ), 'endrev', 'endrev', 10, $this->mEndRev ) . |
| — | — | @@ -86,7 +86,7 @@ |
| 87 | 87 | ); |
| 88 | 88 | $wgOut->addHTML( '<ul>' ); |
| 89 | 89 | # Output any relevant seeming commits... |
| 90 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| | 90 | + foreach ( $res as $row ) { |
| 91 | 91 | $summary = htmlspecialchars( $row->cr_message ); |
| 92 | 92 | # Add this commit summary if needed. |
| 93 | 93 | if ( $row->rnotes || $this->isRelevant( $summary ) ) { |
| Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
| — | — | @@ -615,9 +615,9 @@ |
| 616 | 616 | } |
| 617 | 617 | return '<div class="mw-codereview-post-comment">' . |
| 618 | 618 | $preview . |
| 619 | | - Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . |
| 620 | | - Xml::hidden( 'path', $this->mPath ) . |
| 621 | | - ( $parent ? Xml::hidden( 'wpParent', $parent ) : '' ) . |
| | 619 | + Html::hidden( 'wpEditToken', $wgUser->editToken() ) . |
| | 620 | + Html::hidden( 'path', $this->mPath ) . |
| | 621 | + ( $parent ? Html::hidden( 'wpParent', $parent ) : '' ) . |
| 622 | 622 | '<div>' . |
| 623 | 623 | Xml::openElement( 'textarea', array( |
| 624 | 624 | 'name' => "wpReply{$parent}", |