CINXE.COM

r41716 MediaWiki - Code Review archive

<html> <head> <title>r41716 MediaWiki - Code Review archive</title> <meta charset="utf-8"> <link rel="stylesheet" href="../ext.codereview.styles.css"/> </head> <body> <h1>r41716 MediaWiki - Code Review archive</h1> <div id="mw-content-text" class="mw-body-content"><form action="/wiki/Special:Code/MediaWiki/41716" method="post"><table class="mw-codereview-meta"><tr><td>Repository:</td><td><a href="https://www.mediawiki.org/wiki/Special:Code/MediaWiki" title="Special:Code/MediaWiki">MediaWiki</a></td></tr> <tr><td>Revision:</td><td>&lt;&#160;<a href="./41715.html" title="Special:Code/MediaWiki/41715">r41715</a>‎ | <b>r41716</b> | <a href="./41717.html" title="Special:Code/MediaWiki/41717">r41717</a>&#160;&gt;</td></tr> <tr><td>Date:</td><td>02:31, 6 October 2008</td></tr> <tr><td>Author:</td><td><a href="https://www.mediawiki.org/wiki/Special:Code/MediaWiki/author/tstarling" title="Special:Code/MediaWiki/author/tstarling">tstarling</a></td></tr> <tr><td>Status:</td><td>old</td></tr> <tr><td>Tags:</td><td></td></tr> <tr><td>Comment:</td><td><div class="mw-codereview-message">Disable double redirect fixer by default, pending resolution of <a class="external" href="https://bugzilla.wikimedia.org/show_bug.cgi?id=15622">bug 15622</a>, causes more harm than good.</div></td></tr> <tr><td>Modified paths:</td><td><div class='mw-codereview-paths mw-content-ltr'><ul> <li><b>/trunk/phase3/includes/DefaultSettings.php</b> (modified) (<a href="https://www.mediawiki.org/w/index.php?title=Special:Code/MediaWiki&amp;path=%2Ftrunk%2Fphase3%2Fincludes%2FDefaultSettings.php" title="Special:Code/MediaWiki">history</a>)</li> <li><b>/trunk/phase3/includes/specials/SpecialMovepage.php</b> (modified) (<a href="https://www.mediawiki.org/w/index.php?title=Special:Code/MediaWiki&amp;path=%2Ftrunk%2Fphase3%2Fincludes%2Fspecials%2FSpecialMovepage.php" title="Special:Code/MediaWiki">history</a>)</li> </ul></div> </td></tr> </table> <h2>Diff <small>[<a href="https://www.mediawiki.org/w/index.php?title=Special:Code/MediaWiki/41716&amp;action=purge" title="Special:Code/MediaWiki/41716">purge</a>]</small></h2><div class='mw-codereview-diff' id='mw-codereview-diff'><table class="mw-codereview-diff"><tr id="1" class="patchedfile"><td colspan="3">Index: trunk/phase3/includes/specials/SpecialMovepage.php</td></tr> <tr id="5"><td class="linenumbers">—</td><td class="linenumbers">—</td><td class="chunkdelimiter"><span>@@ -81,7 +81,7 @@</span></td></tr> <tr id="6"><td class="linenumbers">82</td><td class="linenumbers">82</td><td class="unchanged"><span> }</span></td></tr> <tr id="7"><td class="linenumbers">83</td><td class="linenumbers">83</td><td class="unchanged"><span> </span></td></tr> <tr id="8"><td class="linenumbers">84</td><td class="linenumbers">84</td><td class="unchanged"><span> function showForm( $err ) {</span></td></tr> <tr id="9"><td class="linenumbers">85</td><td class="linenumbers"> </td><td class="del"><del>- global $wgOut, $wgUser;</del></td></tr> <tr id="10"><td class="linenumbers"> </td><td class="linenumbers">85</td><td class="ins"><ins>+ global $wgOut, $wgUser, $wgFixDoubleRedirects;</ins></td></tr> <tr id="11"><td class="linenumbers">86</td><td class="linenumbers">86</td><td class="unchanged"><span> </span></td></tr> <tr id="12"><td class="linenumbers">87</td><td class="linenumbers">87</td><td class="unchanged"><span> $skin = $wgUser->getSkin();</span></td></tr> <tr id="13"><td class="linenumbers">88</td><td class="linenumbers">88</td><td class="unchanged"><span> </span></td></tr> <tr id="14"><td class="linenumbers">—</td><td class="linenumbers">—</td><td class="chunkdelimiter"><span>@@ -136,12 +136,16 @@</span></td></tr> <tr id="15"><td class="linenumbers">137</td><td class="linenumbers">137</td><td class="unchanged"><span> $considerTalk = ( !$this->oldTitle->isTalkPage() &amp;&amp; $oldTalk->exists() );</span></td></tr> <tr id="16"><td class="linenumbers">138</td><td class="linenumbers">138</td><td class="unchanged"><span> </span></td></tr> <tr id="17"><td class="linenumbers">139</td><td class="linenumbers">139</td><td class="unchanged"><span> $dbr = wfGetDB( DB_SLAVE );</span></td></tr> <tr id="18"><td class="linenumbers">140</td><td class="linenumbers"> </td><td class="del"><del>- $hasRedirects = $dbr->selectField( 'redirect', '1', </del></td></tr> <tr id="19"><td class="linenumbers">141</td><td class="linenumbers"> </td><td class="del"><del>- array( </del></td></tr> <tr id="20"><td class="linenumbers">142</td><td class="linenumbers"> </td><td class="del"><del>- 'rd_namespace' => $this->oldTitle->getNamespace(),</del></td></tr> <tr id="21"><td class="linenumbers">143</td><td class="linenumbers"> </td><td class="del"><del>- 'rd_title' => $this->oldTitle->getDBkey(),</del></td></tr> <tr id="22"><td class="linenumbers">144</td><td class="linenumbers"> </td><td class="del"><del>- ) , __METHOD__ );</del></td></tr> <tr id="23"><td class="linenumbers">145</td><td class="linenumbers"> </td><td class="del"><del>- </del></td></tr> <tr id="24"><td class="linenumbers"> </td><td class="linenumbers">140</td><td class="ins"><ins>+ if ( $wgFixDoubleRedirects ) {</ins></td></tr> <tr id="25"><td class="linenumbers"> </td><td class="linenumbers">141</td><td class="ins"><ins>+ $hasRedirects = $dbr->selectField( 'redirect', '1', </ins></td></tr> <tr id="26"><td class="linenumbers"> </td><td class="linenumbers">142</td><td class="ins"><ins>+ array( </ins></td></tr> <tr id="27"><td class="linenumbers"> </td><td class="linenumbers">143</td><td class="ins"><ins>+ 'rd_namespace' => $this->oldTitle->getNamespace(),</ins></td></tr> <tr id="28"><td class="linenumbers"> </td><td class="linenumbers">144</td><td class="ins"><ins>+ 'rd_title' => $this->oldTitle->getDBkey(),</ins></td></tr> <tr id="29"><td class="linenumbers"> </td><td class="linenumbers">145</td><td class="ins"><ins>+ ) , __METHOD__ );</ins></td></tr> <tr id="30"><td class="linenumbers"> </td><td class="linenumbers">146</td><td class="ins"><ins>+ } else {</ins></td></tr> <tr id="31"><td class="linenumbers"> </td><td class="linenumbers">147</td><td class="ins"><ins>+ $hasRedirects = false;</ins></td></tr> <tr id="32"><td class="linenumbers"> </td><td class="linenumbers">148</td><td class="ins"><ins>+ }</ins></td></tr> <tr id="33"><td class="linenumbers"> </td><td class="linenumbers">149</td><td class="ins"><ins>+</ins></td></tr> <tr id="34"><td class="linenumbers">146</td><td class="linenumbers">150</td><td class="unchanged"><span> if ( $considerTalk ) {</span></td></tr> <tr id="35"><td class="linenumbers">147</td><td class="linenumbers">151</td><td class="unchanged"><span> $wgOut->addWikiMsg( 'movepagetalktext' );</span></td></tr> <tr id="36"><td class="linenumbers">148</td><td class="linenumbers">152</td><td class="unchanged"><span> }</span></td></tr> <tr id="37"><td class="linenumbers">—</td><td class="linenumbers">—</td><td class="chunkdelimiter"><span>@@ -277,6 +281,7 @@</span></td></tr> <tr id="38"><td class="linenumbers">278</td><td class="linenumbers">282</td><td class="unchanged"><span> </span></td></tr> <tr id="39"><td class="linenumbers">279</td><td class="linenumbers">283</td><td class="unchanged"><span> function doSubmit() {</span></td></tr> <tr id="40"><td class="linenumbers">280</td><td class="linenumbers">284</td><td class="unchanged"><span> global $wgOut, $wgUser, $wgRequest, $wgMaximumMovedPages, $wgLang;</span></td></tr> <tr id="41"><td class="linenumbers"> </td><td class="linenumbers">285</td><td class="ins"><ins>+ global $wgFixDoubleRedirects;</ins></td></tr> <tr id="42"><td class="linenumbers">281</td><td class="linenumbers">286</td><td class="unchanged"><span> </span></td></tr> <tr id="43"><td class="linenumbers">282</td><td class="linenumbers">287</td><td class="unchanged"><span> if ( $wgUser->pingLimiter( 'move' ) ) {</span></td></tr> <tr id="44"><td class="linenumbers">283</td><td class="linenumbers">288</td><td class="unchanged"><span> $wgOut->rateLimited();</span></td></tr> <tr id="45"><td class="linenumbers">—</td><td class="linenumbers">—</td><td class="chunkdelimiter"><span>@@ -320,7 +325,7 @@</span></td></tr> <tr id="46"><td class="linenumbers">321</td><td class="linenumbers">326</td><td class="unchanged"><span> return;</span></td></tr> <tr id="47"><td class="linenumbers">322</td><td class="linenumbers">327</td><td class="unchanged"><span> }</span></td></tr> <tr id="48"><td class="linenumbers">323</td><td class="linenumbers">328</td><td class="unchanged"><span> </span></td></tr> <tr id="49"><td class="linenumbers">324</td><td class="linenumbers"> </td><td class="del"><del>- if ( $this->fixRedirects ) {</del></td></tr> <tr id="50"><td class="linenumbers"> </td><td class="linenumbers">329</td><td class="ins"><ins>+ if ( $wgFixDoubleRedirects &amp;&amp; $this->fixRedirects ) {</ins></td></tr> <tr id="51"><td class="linenumbers">325</td><td class="linenumbers">330</td><td class="unchanged"><span> DoubleRedirectJob::fixRedirects( 'move', $ot, $nt );</span></td></tr> <tr id="52"><td class="linenumbers">326</td><td class="linenumbers">331</td><td class="unchanged"><span> }</span></td></tr> <tr id="53"><td class="linenumbers">327</td><td class="linenumbers">332</td><td class="unchanged"><span> </span></td></tr> <tr id="54" class="patchedfile"><td colspan="3">Index: trunk/phase3/includes/DefaultSettings.php</td></tr> <tr id="58"><td class="linenumbers">—</td><td class="linenumbers">—</td><td class="chunkdelimiter"><span>@@ -3432,6 +3432,12 @@</span></td></tr> <tr id="59"><td class="linenumbers">3433</td><td class="linenumbers">3433</td><td class="unchanged"><span> $wgMaximumMovedPages = 100;</span></td></tr> <tr id="60"><td class="linenumbers">3434</td><td class="linenumbers">3434</td><td class="unchanged"><span> </span></td></tr> <tr id="61"><td class="linenumbers">3435</td><td class="linenumbers">3435</td><td class="unchanged"><span> /**</span></td></tr> <tr id="62"><td class="linenumbers"> </td><td class="linenumbers">3436</td><td class="ins"><ins>+ * Fix double redirects after a page move.</ins></td></tr> <tr id="63"><td class="linenumbers"> </td><td class="linenumbers">3437</td><td class="ins"><ins>+ * Tends to conflict with page move vandalism, use only on a private wiki. </ins></td></tr> <tr id="64"><td class="linenumbers"> </td><td class="linenumbers">3438</td><td class="ins"><ins>+ */</ins></td></tr> <tr id="65"><td class="linenumbers"> </td><td class="linenumbers">3439</td><td class="ins"><ins>+$wgFixDoubleRedirects = false;</ins></td></tr> <tr id="66"><td class="linenumbers"> </td><td class="linenumbers">3440</td><td class="ins"><ins>+</ins></td></tr> <tr id="67"><td class="linenumbers"> </td><td class="linenumbers">3441</td><td class="ins"><ins>+/**</ins></td></tr> <tr id="68"><td class="linenumbers">3436</td><td class="linenumbers">3442</td><td class="unchanged"><span> * Array of namespaces to generate a sitemap for when the</span></td></tr> <tr id="69"><td class="linenumbers">3437</td><td class="linenumbers">3443</td><td class="unchanged"><span> * maintenance/generateSitemap.php script is run, or false if one is to be ge-</span></td></tr> <tr id="70"><td class="linenumbers">3438</td><td class="linenumbers">3444</td><td class="unchanged"><span> * nerated for all namespaces.</span></td></tr> </table> </div> <h2 id='code-changes'>Status &amp; tagging log</h2> <ul class='mw-codereview-changes'><li>15:32, 12 September 2011&#160;<a href="https://www.mediawiki.org/wiki/User:Meno25" class="mw-userlink" title="User:Meno25"><bdi>Meno25</bdi></a> <span class="mw-usertoollinks">(<a href="https://www.mediawiki.org/wiki/User_talk:Meno25" class="mw-usertoollinks-talk" title="User talk:Meno25">talk</a> | <a href="https://www.mediawiki.org/wiki/Special:Contributions/Meno25" class="mw-usertoollinks-contribs" title="Special:Contributions/Meno25">contribs</a>)</span>&#160;changed the <b>status</b> of r41716 <i>[<b>removed:</b> ok&#160;<b>added:</b> old]</i></li></ul></form></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10