<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=User%3AIlmari_Karonen%2FfixDoubleRedirects</id>
	<title>User:Ilmari Karonen/fixDoubleRedirects - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=User%3AIlmari_Karonen%2FfixDoubleRedirects"/>
	<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;action=history"/>
	<updated>2026-06-09T11:22:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.5</generator>
	<entry>
		<id>https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67534&amp;oldid=prev</id>
		<title>Ilmari Karonen: fix option desc and year in copyright statement</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67534&amp;oldid=prev"/>
		<updated>2011-02-02T21:30:27Z</updated>

		<summary type="html">&lt;p&gt;fix option desc and year in copyright statement&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:30, 2 February 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * Script to fix double redirects.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * Script to fix double redirects.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * Copyright (C) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2010 &lt;/del&gt;Ilmari Karonen &amp;lt;nospam@vyznev.net&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * Copyright (C) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2011 &lt;/ins&gt;Ilmari Karonen &amp;lt;nospam@vyznev.net&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * http://www.mediawiki.org/&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * http://www.mediawiki.org/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot; &gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		parent::__construct();&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		parent::__construct();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;mDescription = &amp;quot;Script to fix double redirects&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;mDescription = &amp;quot;Script to fix double redirects&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;addOption( 'async', 'Don\'t fix anything directly, just &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;add &lt;/del&gt;queue the jobs' );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;addOption( 'async', 'Don\'t fix anything directly, just queue the jobs' );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;addOption( 'title', 'Fix only redirects pointing to this page', false, true );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;addOption( 'title', 'Fix only redirects pointing to this page', false, true );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;addOption( 'dry-run', 'Perform a dry run, fix nothing' );		&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$this-&amp;gt;addOption( 'dry-run', 'Perform a dry run, fix nothing' );		&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ilmari Karonen</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67533&amp;oldid=prev</id>
		<title>Ilmari Karonen: fix svn link in description text</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67533&amp;oldid=prev"/>
		<updated>2011-02-02T21:11:58Z</updated>

		<summary type="html">&lt;p&gt;fix svn link in description text&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:11, 2 February 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a (hopefully) MW 1.16 -compatible version of [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/fixDoubleRedirects.php&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;&lt;/del&gt;view=markup].  Remember to create [[MediaWiki:double-redirect-fixed-maintenance]] (as e.g. &amp;quot;&amp;lt;nowiki&amp;gt;Fixing double redirect from [[$1]] to [[$2]].&amp;lt;/nowiki&amp;gt;&amp;quot;) before running this script.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a (hopefully) MW 1.16 -compatible version of [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/fixDoubleRedirects.php&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;?&lt;/ins&gt;view=markup &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;maintenance/fixDoubleRedirects.php&lt;/ins&gt;].  Remember to create [[MediaWiki:double-redirect-fixed-maintenance]] (as e.g. &amp;quot;&amp;lt;nowiki&amp;gt;Fixing double redirect from [[$1]] to [[$2]].&amp;lt;/nowiki&amp;gt;&amp;quot;) before running this script.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=PHP&amp;gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=PHP&amp;gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ilmari Karonen</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67469&amp;oldid=prev</id>
		<title>Ilmari Karonen: more fixes, now with actual testing :)</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67469&amp;oldid=prev"/>
		<updated>2011-02-02T20:56:58Z</updated>

		<summary type="html">&lt;p&gt;more fixes, now with actual testing :)&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:56, 2 February 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l66&quot; &gt;Line 66:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 66:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			'rd_namespace = pb.page_namespace',&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			'rd_namespace = pb.page_namespace',&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			'rd_title = pb.page_title',&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			'rd_title = pb.page_title',&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&lt;/del&gt;pb.page_is_redirect = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;1&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&amp;quot;&lt;/del&gt;,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;pb.page_is_redirect&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;' &lt;/ins&gt;=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; &lt;/ins&gt;1,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l75&quot; &gt;Line 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// TODO: support batch querying&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// TODO: support batch querying&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$sql = &amp;quot;SELECT &amp;quot; . implode( ' ', $fields ) . &amp;quot; FROM $redirTable, $pageTable AS pa, $pageTable AS pb WHERE &amp;quot; . &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;implode&lt;/del&gt;( &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;' ', &lt;/del&gt;$conds );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$sql = &amp;quot;SELECT &amp;quot; . implode( '&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,&lt;/ins&gt;', $fields ) .&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;			&lt;/ins&gt;&amp;quot; FROM $redirTable, $pageTable AS pa, $pageTable AS pb WHERE &amp;quot; .&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;			$dbr-&amp;gt;makeList&lt;/ins&gt;( $conds&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, LIST_AND &lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$res = $dbr-&amp;gt;query( $sql, __METHOD__ );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$res = $dbr-&amp;gt;query( $sql, __METHOD__ );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ilmari Karonen</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67468&amp;oldid=prev</id>
		<title>Ilmari Karonen: fix it right this time, I hope</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67468&amp;oldid=prev"/>
		<updated>2011-02-02T20:48:05Z</updated>

		<summary type="html">&lt;p&gt;fix it right this time, I hope&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:48, 2 February 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l75&quot; &gt;Line 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// TODO: support batch querying&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// TODO: support batch querying&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$sql = implode(	' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;', array( 'SELECT&lt;/del&gt;', $fields&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, &lt;/del&gt;&amp;quot;FROM $redirTable, $pageTable AS pa, $pageTable AS pb WHERE&amp;quot;, $conds &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;) &lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$sql = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;SELECT &amp;quot; . &lt;/ins&gt;implode( ' ', $fields &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;) . &lt;/ins&gt;&amp;quot; FROM $redirTable, $pageTable AS pa, $pageTable AS pb WHERE &amp;quot; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. implode( ' '&lt;/ins&gt;, $conds );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$res = $dbr-&amp;gt;query( $sql, __METHOD__ );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$res = $dbr-&amp;gt;query( $sql, __METHOD__ );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ilmari Karonen</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67467&amp;oldid=prev</id>
		<title>Ilmari Karonen: fix implode() params</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67467&amp;oldid=prev"/>
		<updated>2011-02-02T20:44:17Z</updated>

		<summary type="html">&lt;p&gt;fix implode() params&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:44, 2 February 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l75&quot; &gt;Line 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// TODO: support batch querying&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// TODO: support batch querying&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$sql = implode(	' ', 'SELECT', $fields,	&amp;quot;FROM $redirTable, $pageTable AS pa, $pageTable AS pb WHERE&amp;quot;, $conds );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$sql = implode(	' ', &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;array( &lt;/ins&gt;'SELECT', $fields, &amp;quot;FROM $redirTable, $pageTable AS pa, $pageTable AS pb WHERE&amp;quot;, $conds &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;) &lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$res = $dbr-&amp;gt;query( $sql, __METHOD__ );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		$res = $dbr-&amp;gt;query( $sql, __METHOD__ );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ilmari Karonen</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67466&amp;oldid=prev</id>
		<title>Ilmari Karonen: try this, paxed</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User:Ilmari_Karonen/fixDoubleRedirects&amp;diff=67466&amp;oldid=prev"/>
		<updated>2011-02-02T20:39:32Z</updated>

		<summary type="html">&lt;p&gt;try this, paxed&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a (hopefully) MW 1.16 -compatible version of [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/fixDoubleRedirects.php&amp;amp;view=markup].  Remember to create [[MediaWiki:double-redirect-fixed-maintenance]] (as e.g. &amp;quot;&amp;lt;nowiki&amp;gt;Fixing double redirect from [[$1]] to [[$2]].&amp;lt;/nowiki&amp;gt;&amp;quot;) before running this script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=PHP&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Script to fix double redirects.&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright (C) 2010 Ilmari Karonen &amp;lt;nospam@vyznev.net&amp;gt;&lt;br /&gt;
 * http://www.mediawiki.org/&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU General Public License as published by&lt;br /&gt;
 * the Free Software Foundation; either version 2 of the License, or&lt;br /&gt;
 * (at your option) any later version.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU General Public License along&lt;br /&gt;
 * with this program; if not, write to the Free Software Foundation, Inc.,&lt;br /&gt;
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.&lt;br /&gt;
 * http://www.gnu.org/copyleft/gpl.html&lt;br /&gt;
 *&lt;br /&gt;
 * @file&lt;br /&gt;
 * @author Ilmari Karonen &amp;lt;nospam@vyznev.net&amp;gt;&lt;br /&gt;
 * @ingroup Maintenance&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
require_once( dirname( __FILE__ ) . '/Maintenance.php' );&lt;br /&gt;
&lt;br /&gt;
class FixDoubleRedirects extends Maintenance {&lt;br /&gt;
	public function __construct() {&lt;br /&gt;
		parent::__construct();&lt;br /&gt;
		$this-&amp;gt;mDescription = &amp;quot;Script to fix double redirects&amp;quot;;&lt;br /&gt;
		$this-&amp;gt;addOption( 'async', 'Don\'t fix anything directly, just add queue the jobs' );&lt;br /&gt;
		$this-&amp;gt;addOption( 'title', 'Fix only redirects pointing to this page', false, true );&lt;br /&gt;
		$this-&amp;gt;addOption( 'dry-run', 'Perform a dry run, fix nothing' );		&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function execute() {&lt;br /&gt;
		$async = $this-&amp;gt;getOption( 'async', false );&lt;br /&gt;
		$dryrun = $this-&amp;gt;getOption( 'dry-run', false );&lt;br /&gt;
		$title = $this-&amp;gt;getOption( 'title' );&lt;br /&gt;
&lt;br /&gt;
		if ( isset( $title ) ) {&lt;br /&gt;
			$title = Title::newFromText( $title );&lt;br /&gt;
			if ( !$title || !$title-&amp;gt;isRedirect() ) {&lt;br /&gt;
				$this-&amp;gt;error( $title-&amp;gt;getPrefixedText() . &amp;quot; is not a redirect!\n&amp;quot;, true );&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$dbr = wfGetDB( DB_SLAVE );&lt;br /&gt;
&lt;br /&gt;
		$pageTable = $dbr-&amp;gt;tableName( 'page' );&lt;br /&gt;
		$redirTable = $dbr-&amp;gt;tableName( 'redirect' );&lt;br /&gt;
&lt;br /&gt;
		$fields = array(&lt;br /&gt;
			'pa.page_namespace AS pa_namespace',&lt;br /&gt;
			'pa.page_title AS pa_title',&lt;br /&gt;
			'pb.page_namespace AS pb_namespace',&lt;br /&gt;
			'pb.page_title AS pb_title',&lt;br /&gt;
		);&lt;br /&gt;
		$conds = array(&lt;br /&gt;
			'rd_from = pa.page_id',&lt;br /&gt;
			'rd_namespace = pb.page_namespace',&lt;br /&gt;
			'rd_title = pb.page_title',&lt;br /&gt;
			&amp;quot;pb.page_is_redirect = '1'&amp;quot;,&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if ( isset( $title ) ) {&lt;br /&gt;
			$conds['pb.page_namespace'] = $title-&amp;gt;getNamespace();&lt;br /&gt;
			$conds['pb.page_title'] = $title-&amp;gt;getDBkey();&lt;br /&gt;
		}&lt;br /&gt;
		// TODO: support batch querying&lt;br /&gt;
&lt;br /&gt;
		$sql = implode(	' ', 'SELECT', $fields,	&amp;quot;FROM $redirTable, $pageTable AS pa, $pageTable AS pb WHERE&amp;quot;, $conds );&lt;br /&gt;
&lt;br /&gt;
		$res = $dbr-&amp;gt;query( $sql, __METHOD__ );&lt;br /&gt;
&lt;br /&gt;
		if ( !$res-&amp;gt;numRows() ) {&lt;br /&gt;
			$this-&amp;gt;output( &amp;quot;No double redirects found.\n&amp;quot; );&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$jobs = array();&lt;br /&gt;
		$n = 0;&lt;br /&gt;
		foreach ( $res as $row ) {&lt;br /&gt;
			$titleA = Title::makeTitle( $row-&amp;gt;pa_namespace, $row-&amp;gt;pa_title );&lt;br /&gt;
			$titleB = Title::makeTitle( $row-&amp;gt;pb_namespace, $row-&amp;gt;pb_title );&lt;br /&gt;
&lt;br /&gt;
			$job = new DoubleRedirectJob( $titleA, array( 'reason' =&amp;gt; 'maintenance', 'redirTitle' =&amp;gt; $titleB-&amp;gt;getPrefixedDBkey() ) );&lt;br /&gt;
&lt;br /&gt;
			if ( !$async ) {&lt;br /&gt;
				$success = ( $dryrun ? true : $job-&amp;gt;run() );&lt;br /&gt;
				if ( !$success ) {&lt;br /&gt;
					$this-&amp;gt;error( &amp;quot;Error fixing &amp;quot; . $titleA-&amp;gt;getPrefixedText() . &amp;quot;: &amp;quot; . $job-&amp;gt;getLastError() . &amp;quot;\n&amp;quot; );&lt;br /&gt;
				}&lt;br /&gt;
			} else {&lt;br /&gt;
				$jobs[] = $job;&lt;br /&gt;
				// FIXME: hardcoded constant 10000 copied from DoubleRedirectJob class&lt;br /&gt;
				if ( count( $jobs ) &amp;gt; 10000 ) {&lt;br /&gt;
					$this-&amp;gt;queueJobs( $jobs, $dryrun );&lt;br /&gt;
					$jobs = array();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			if ( ++$n % 100 == 0 ) {&lt;br /&gt;
				$this-&amp;gt;output( &amp;quot;$n...\n&amp;quot; );&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if ( count( $jobs ) ) {&lt;br /&gt;
			$this-&amp;gt;queueJobs( $jobs, $dryrun );&lt;br /&gt;
		}&lt;br /&gt;
		$this-&amp;gt;output( &amp;quot;$n double redirects processed.\n&amp;quot; );&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	protected function queueJobs( $jobs, $dryrun = false ) {&lt;br /&gt;
		$this-&amp;gt;output( &amp;quot;Queuing batch of &amp;quot; . count( $jobs ) . &amp;quot; double redirects.\n&amp;quot; );&lt;br /&gt;
		Job::batchInsert( $dryrun ? array() : $jobs );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$maintClass = &amp;quot;FixDoubleRedirects&amp;quot;;&lt;br /&gt;
require_once( DO_MAINTENANCE );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ilmari Karonen</name></author>
		
	</entry>
</feed>