r9318 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9317‎ | r9318 | r9319 >
Date:14:51, 3 June 2005
Author:vibber
Status:old
Tags:
Comment:
Bump to 1.4.5
Modified paths:
  • /branches/REL1_4/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_4/phase3/includes/DefaultSettings.php (modified) (history)
  • /branches/REL1_4/phase3/includes/Parser.php (modified) (history)
  • /branches/REL1_4/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: branches/REL1_4/phase3/maintenance/parserTests.txt
@@ -1966,6 +1966,91 @@
19671967 !!end
19681968
19691969
 1970+###
 1971+### Safety
 1972+###
 1973+
 1974+!! test
 1975+Bug 2304: HTML attribute safety (template)
 1976+!! input
 1977+<div title="{{test}}"></div>
 1978+!! result
 1979+<div title="&#123;&#123;test}}"></div >
 1980+
 1981+!! end
 1982+
 1983+!! test
 1984+Bug 2304: HTML attribute safety (link)
 1985+!! input
 1986+<div title="[[Main Page]]"></div>
 1987+!! result
 1988+<div title="&#91;&#91;Main Page]]"></div >
 1989+
 1990+!! end
 1991+
 1992+!! test
 1993+Bug 2304: HTML attribute safety (italics)
 1994+!! input
 1995+<div title="''foobar''"></div>
 1996+!! result
 1997+<div title="&#39;&#39;foobar&#39;&#39;"></div >
 1998+
 1999+!! end
 2000+
 2001+!! test
 2002+Bug 2304: HTML attribute safety (bold)
 2003+!! input
 2004+<div title="'''foobar'''"></div>
 2005+!! result
 2006+<div title="&#39;&#39;'foobar&#39;&#39;'"></div >
 2007+
 2008+!! end
 2009+
 2010+!! test
 2011+Bug 2304: HTML attribute safety (ISBN)
 2012+!! input
 2013+<div title="ISBN 1234567890"></div>
 2014+!! result
 2015+<div title="&#73;SBN 1234567890"></div >
 2016+
 2017+!! end
 2018+
 2019+!! test
 2020+Bug 2304: HTML attribute safety (RFC)
 2021+!! input
 2022+<div title="RFC 1234"></div>
 2023+!! result
 2024+<div title="&#82;FC 1234"></div >
 2025+
 2026+!! end
 2027+
 2028+!! test
 2029+Bug 2304: HTML attribute safety (PMID)
 2030+!! input
 2031+<div title="PMID 1234567890"></div>
 2032+!! result
 2033+<div title="&#80;MID 1234567890"></div >
 2034+
 2035+!! end
 2036+
 2037+!! test
 2038+Bug 2304: HTML attribute safety (web link)
 2039+!! input
 2040+<div title="http://example.com/"></div>
 2041+!! result
 2042+<div title="http&#58;//example.com/"></div >
 2043+
 2044+!! end
 2045+
 2046+!! test
 2047+Bug 2304: HTML attribute safety (named web link)
 2048+!! input
 2049+<div title="[http://example.com/ link]"></div>
 2050+!! result
 2051+<div title="&#91;http&#58;//example.com/ link]"></div >
 2052+
 2053+!! end
 2054+
19702055 TODO:
19712056 more images
19722057 more tables
Index: branches/REL1_4/phase3/includes/Parser.php
@@ -496,6 +496,20 @@
497497 {
498498 $t='';
499499 }
 500+
 501+ # Templates and links may be expanded in later parsing,
 502+ # creating invalid or dangerous output. Suppress this.
 503+ $t = strtr( $t, array(
 504+ '{' => '&#123;',
 505+ '[' => '&#91;',
 506+ "''" => '&#39;&#39;',
 507+ 'ISBN' => '&#73;SBN',
 508+ 'RFC' => '&#82;FC',
 509+ 'PMID' => '&#80;MID',
 510+ ) );
 511+ $t = preg_replace(
 512+ '/(' . URL_PROTOCOLS . '):/',
 513+ '\\1&#58;', $t );
500514
501515 return trim ( $t ) ;
502516 }
Index: branches/REL1_4/phase3/includes/DefaultSettings.php
@@ -19,7 +19,7 @@
2020 * MediaWiki version number
2121 * @global string $wgVersion
2222 */
23 -$wgVersion = '1.4.4';
 23+$wgVersion = '1.4.5';
2424
2525 /**
2626 * Name of the site.
Index: branches/REL1_4/phase3/RELEASE-NOTES
@@ -5,11 +5,28 @@
66
77 == MediaWiki 1.4.5 ==
88
9 -(to be released)
 9+(released 2005-06-03)
1010
11 -Various minor bug fixes, some backports.
 11+MediaWiki 1.4.5 is a security update and bugfix release.
1212
 13+Incorrect handling of page template inclusions made it possible to
 14+inject JavaScript code into HTML attributes, which could lead to
 15+cross-site scripting attacks on a publicly editable wiki.
1316
 17+Vulnerable releases and fix:
 18+* 1.5 prerelease: fixed in 1.5alpha2
 19+* 1.4 stable series: fixed in 1.4.5
 20+* 1.3 legacy series: fixed in 1.3.13
 21+* 1.2 series no longer supported; upgrade to 1.4.5 strongly recommended
 22+
 23+This release also includes a number of bug fixes (see changelog below)
 24+and merges some large-server load balancing patches from Wikipedia.
 25+
 26+An experimental rate limiter for page edits and moves can be enabled
 27+with global, per-IP, per-subnet, or per-user bases. See configuration
 28+options in includes/DefaultSettings.php
 29+
 30+
1431 == MediaWiki 1.4.4 ==
1532
1633 (released 2005-05-04)
@@ -611,6 +628,7 @@
612629 * (bug 2281) Fix regression with page moves taking the wrong talk pages
613630 * Regression fix: watchlist day cutoff
614631 * (bug 2173) Fatal error when removing an article with an empty title from the watchlist
 632+* (bug 2034) Armor HTML attributes against template inclusion and links munging
615633
616634
617635 === Caveats ===

Status & tagging log