== MediaWiki 1.20 ==
-THIS IS NOT A RELEASE YET
-
-MediaWiki 1.20 is an alpha-quality branch and is not recommended for use in
-production.
+MediaWiki 1.20 is a stable release.
=== PHP 5.3 now required ===
Since 1.20, the lowest supported version of PHP is now 5.3.2. Please
* (bug 40448) mediawiki.legacy.mwsuggest has been replaced with a new module,
mediawiki.searchSuggest, based on SimpleSeach from Extension:Vector.
+=== Known issues in 1.20.0 ===
+These are issues that we're targeting to be fixed in a later release
+in the 1.20 series. Issues may be added or removed from this list as
+we see fit. For now, it is comprised of those bugs on the 1.20.0
+milestone in Bugzilla.
+
+* (bug 35894): Reports of secret key generation "hanging" on windows
+ This is probably a bug that has been fixed in PHP. If you run
+ into this, try upgrading your PHP.
+* (bug 38334): PHP Notice: Undefined index: href in /www/w/skins/Vector.php on line 416
+ We think this is a problem in some extension. If you see this,
+ try disabling your extensions and check out the logging patch on
+ this bug. Or try this patch:
+ <https://gerrit.wikimedia.org/r/#/c/27937/1/skins/Vector.php>
+* (bug 39268): [Regression] Toolbar inserts in main textarea only (instead of the focussed textarea)
+ This should only be an issue if you are using the ProofreadPage
+ extension.
+* (bug 40641): Clicking "others" in Special:Version asks to download a file
+ If you encounter this, you can tell your webserver to serve the
+ CREDITS file with text/plain MIME type to fix it.
+
=== Bug fixes in 1.20 ===
+* (bug 40939): [Regression] InfoAction: Call to a member function getUserText() on a non-object
+* (bug 40780): searchsuggest-containing line ("containing...") doesn't include the entered text
+* (bug 37714): [Regression] Incomplete log entries
+* (bug 27202): API: Add timestamp sort to list=allimages
* (bug 30245) Use the correct way to construct a log page title.
* (bug 34237) Regenerate an empty user_token and save to the database
when we try to set the user's cookies for login.
caught during API execution.
* (bug 37963) Fixed loading process for user options
* (bug 26995) Update filename field on Upload page after having sanitized it.
+* (bug 41793) Contribution links to users with 0 edits on Special:ListUsers didn't
+ show up red.
=== API changes in 1.21 ===
* prop=revisions can now report the contentmodel and contentformat, see docs/contenthandler.txt
$terms: The search terms entered
$page: The SpecialSearch object.
+'ShowSearchHit': Customize display of search hit.
+$searchPage: The SpecialSearch instance.
+$result: The SearchResult to show
+$terms: Search terms, for highlighting
+&$link: HTML of link to the matching page. May be modified.
+&$redirect: HTML of redirect info. May be modified.
+&$section: HTML of matching section. May be modified.
+&$extract: HTML of content extract. May be modified.
+&$score: HTML of score. May be modified.
+&$size: HTML of page size. May be modified.
+&$date: HTML of of page modification date. May be modified.
+&$related: HTML of additional info for the matching page. May be modified.
+&$html: May be set to the full HTML that should be used to represent the search hit. Must include
+the <li> ... </li> tags. Will only be used if the hook function returned false.
+
'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
&$siteNotice: HTML returned as the sitenotice
$skin: Skin object
$count = $this->initEditCount();
}
wfProfileOut( __METHOD__ );
- $this->mEditCount = $count;
+ $this->mEditCount = intval( $count );
}
return $this->mEditCount;
} else {
$rcid = 0, # FIXME: use everywhere!
$refreshCache = false, $unhide = false
) {
- $this->checkModelID( $context->getTitle()->getContentModel() );
-
$diffEngineClass = $this->getDiffEngineClass();
return new $diffEngineClass( $context, $old, $new, $rcid, $refreshCache, $unhide );
switch ( $type ) {
case 'array':
$value = (array)$value;
+ // fall-through!
case 'blob':
$value = serialize( $value );
+ // fall-through!
}
$values[$this->table->getPrefixedField( $name )] = $value;
$this->table->getName(),
$this->getWriteValues(),
is_null( $functionName ) ? __METHOD__ : $functionName,
- is_null( $options ) ? array( 'IGNORE' ) : $options
+ $options
);
// DatabaseBase::insert does not always return true for success as documented...
}
if( !$this->title || $this->title->getNamespace() == NS_FILE ) {
+ $this->dataLoaded = true; // set it here, to have also true on miss
$dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select( 'filearchive',
+ $row = $dbr->selectRow( 'filearchive',
array(
'fa_id',
'fa_name',
'fa_sha1' ),
$conds,
__METHOD__,
- array( 'ORDER BY' => 'fa_timestamp DESC' ) );
- if ( $res == false || $dbr->numRows( $res ) == 0 ) {
- // this revision does not exist?
+ array( 'ORDER BY' => 'fa_timestamp DESC')
+ );
+ if ( !$row ) {
+ // this revision does not exist?
return null;
}
- $ret = $dbr->resultObject( $res );
- $row = $ret->fetchObject();
// initialize fields for filestore image object
$this->loadFromRow( $row );
} else {
throw new MWException( 'This title does not correspond to an image page.' );
}
- $this->dataLoaded = true;
$this->exists = true;
return true;
'forward' => false,
'config' => array(),
+ 'language' => 'en', // XXX: can we default to '' instead?
);
}
$userName = $row->user_name;
$ulinks = Linker::userLink( $row->user_id, $userName );
- $ulinks .= Linker::userToolLinks( $row->user_id, $userName );
+ $ulinks .= Linker::userToolLinksRedContribs( $row->user_id, $userName, intval( $row->edits ) );
$lang = $this->getLanguage();
}
}
- wfProfileOut( __METHOD__ );
- return "<li><div class='mw-search-result-heading'>{$link} {$redirect} {$section}</div> {$extract}\n" .
- "<div class='mw-search-result-data'>{$score}{$size} - {$date}{$related}</div>" .
- "</li>\n";
+ $html = null;
+
+ if ( wfRunHooks( 'ShowSearchHit', array (
+ $this, $result, $terms,
+ &$link, &$redirect, &$section, &$extract,
+ &$score, &$size, &$date, &$related,
+ &$html
+ ) ) ) {
+ $html = "<li><div class='mw-search-result-heading'>{$link} {$redirect} {$section}</div> {$extract}\n" .
+ "<div class='mw-search-result-data'>{$score}{$size} - {$date}{$related}</div>" .
+ "</li>\n";
+ }
+ wfProfileOut( __METHOD__ );
+ return $html;
}
/**
background-color: #cc0000;
padding: 0 3px;
text-align: center;
+ font-size: 12px;
+ line-height: 12px;
}
.mw-badge-content {
- font-size: 12px;
font-weight: bold;
- line-height: 12px;
color: white;
vertical-align: baseline;
text-shadow: 0 1px rgba(0, 0, 0, 0.4);
!! endarticle
!! article
-Template:!
+Template:pipe
!! text
|
!! endarticle
* item 1
!! endarticle
+!! article
+Template:!
+!! text
+|
+!! endarticle
+
!! article
Template:echo
!! text
!!input
{{echo| foo}}
+{{echo| foo}}{{echo| bar}}
+
{{echo| foo}}
{{echo| bar}}
!!result
<pre>foo
</pre>
+<pre>foo bar
+</pre>
<pre>foo
bar
</pre>
</pre>
!!end
+!! test
+Templates: Pre: 1f: Wrapping should be based on expanded content
+!! input
+{{echo| }}a
+
+{{echo|
+ }}a
+
+{{echo|
+ b}}
+
+{{echo|a
+ }}b
+
+{{echo|a
+}} b
+!!result
+<pre>a
+</pre>
+<p><br />
+</p>
+<pre>a
+</pre>
+<p><br />
+</p>
+<pre>b
+</pre>
+<p>a
+</p>
+<pre>b
+</pre>
+<p>a
+</p>
+<pre>b
+</pre>
+!!end
+
###
### Parsoid-centric tests for testing RT edge cases for pre
###
!!end
!!test
-3. Pre and block tags
+3a. Pre and block tags (single-line html)
!!input
<p> foo </p>
<div> foo </div>
</pre>
!!end
+!!test
+3b. Pre and block tags (pre-content on separate line)
+!!input
+<p>
+ foo
+</p>
+
+<div>
+ foo
+</div>
+
+<center>
+ foo
+</center>
+
+<blockquote>
+ foo
+</blockquote>
+
+<table><tr><td>
+ foo
+</td></tr></table>
+
+<ul><li>
+ foo
+</li></ul>
+
+!!result
+<p>
+ foo
+</p>
+<div>
+<pre>foo
+</pre>
+</div>
+<center>
+<pre>foo
+</pre>
+</center>
+<blockquote>
+ foo
+</blockquote>
+<table><tr><td>
+<pre>foo
+</pre>
+</td></tr></table>
+<ul><li>
+ foo
+</li></ul>
+
+!!end
+
!!test
4. Multiple spaces at start-of-line
!!input
Definition and unordered list using wiki syntax nested in unordered list using html tags.
!! input
<ul><li>
-; term : description
+; term : description
* unordered
</li>
</ul>
!! result
<ul><li>
-<dl><dt> term </dt><dd> description
+<dl><dt> term </dt><dd> description
</dd></dl>
<ul><li> unordered
</li></ul>
!! test
Simple table
!! input
-{|
+{|
| 1 || 2
-|-
+|-
| 3 || 4
|}
!! result
!! test
Simple table but with multiple dashes for row wikitext
!! input
-{|
+{|
| foo
|-----
| bar
Table rowspan
!! input
{| border=1
-| Cell 1, row 1
-|rowspan=2| Cell 2, row 1 (and 2)
-| Cell 3, row 1
-|-
-| Cell 1, row 2
-| Cell 3, row 2
+| Cell 1, row 1
+|rowspan=2| Cell 2, row 1 (and 2)
+| Cell 3, row 1
+|-
+| Cell 1, row 2
+| Cell 3, row 2
|}
!! result
<table border="1">
!! test
BUG 553: link with two variables in a piped link
!! input
-{|
+{|
|[[{{{1}}}|{{{2}}}]]
|}
!! result
!! article
Template:table
!! text
-{|
+{|
| 1 || 2
-|-
+|-
| 3 || 4
|}
!! endarticle
!!end
!!test
-Templates: Tables: 1. Generating start of a HTML table
+Templates: HTML Tables: 1. Generating start of a HTML table
!!input
{{echo|<table><tr><td>foo</td>}}</tr></table>
!!result
!!end
!!test
-Templates: Tables: 2a. Generating middle of a HTML table
+Templates: HTML Tables: 2a. Generating middle of a HTML table
!!input
<table><tr>{{echo|<td>foo</td>}}</tr></table>
!!result
!!end
!!test
-Templates: Tables: 2b. Generating middle of a HTML table
+Templates: HTML Tables: 2b. Generating middle of a HTML table
!!input
<table>{{echo|<tr><td>foo</td></tr>}}</table>
!!result
!!end
!!test
-Templates: Tables: 3. Generating end of a HTML table
+Templates: HTML Tables: 3. Generating end of a HTML table
!!input
<table><tr>{{echo|<td>foo</td></tr></table>}}
!!result
!!end
!!test
-Templates: Tables: 4a. Generating a single tag of a HTML table
+Templates: HTML Tables: 4a. Generating a single tag of a HTML table
!!input
{{echo|<table>}}<tr><td>foo</td></tr></table>
!!result
!!end
!!test
-Templates: Tables: 4b. Generating a single tag of a HTML table
+Templates: HTML Tables: 4b. Generating a single tag of a HTML table
!!input
<table>{{echo|<tr>}}<td>foo</td></tr></table>
!!result
!!end
!!test
-Templates: Tables: 4c. Generating a single tag of a HTML table
+Templates: HTML Tables: 4c. Generating a single tag of a HTML table
!!input
<table><tr>{{echo|<td>}}foo</td></tr></table>
!!result
!!end
!!test
-Templates: Tables: 4d. Generating a single tag of a HTML table
+Templates: HTML Tables: 4d. Generating a single tag of a HTML table
!!input
<table><tr><td>foo{{echo|</td>}}</tr></table>
!!result
!!end
!!test
-Templates: Tables: 4e. Generating a single tag of a HTML table
+Templates: HTML Tables: 4e. Generating a single tag of a HTML table
!!input
<table><tr><td>foo</td>{{echo|</tr>}}</table>
!!result
!!end
!!test
-Templates: Tables: 4f. Generating a single tag of a HTML table
+Templates: HTML Tables: 4f. Generating a single tag of a HTML table
!!input
<table><tr><td>foo</td></tr>{{echo|</table>}}
!!result
!!end
+!!test
+Templates: Wiki Tables: 1. Fostering of entire template content
+!!input
+{|
+{{echo|a}}
+|}
+!!result
+<table>
+a
+<tr><td></td></tr></table>
+
+!!end
+
+!!test
+Templates: Wiki Tables: 2. Fostering of partial template content
+!!input
+{|
+{{echo|a
+<div>b</div>}}
+|}
+!!result
+<table>
+a
+<div>b</div>
+<tr><td></td></tr></table>
+
+!!end
+
+!!test
+Templates: Wiki Tables: 3. td-content via multiple templates
+!!input
+{|
+{{echo|{{pipe}}a}}{{echo|b}}
+|}
+!!result
+<table>
+<tr>
+<td>ab
+</td></tr></table>
+
+!!end
+
+!!test
+Templates: Lists: Multi-line list-items via templates
+!!input
+*{{echo|a {{nonexistent|
+unused}}}}
+*{{echo|b {{nonexistent|
+unused}}}}
+!!result
+<ul><li>a <a href="/index.php?title=Template:Nonexistent&action=edit&redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a>
+</li><li>b <a href="/index.php?title=Template:Nonexistent&action=edit&redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a>
+</li></ul>
+
+!!end
+
!!test
Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)
!!input
!!end
!! test
-Headings: 1. Nested inside html
+Headings: 1. Nested inside html
!! options
disabled
!! input
!!end
!! test
-Headings: 3. Nested inside html with wikitext split by html tags
+Headings: 3. Nested inside html with wikitext split by html tags
!! options
disabled
!! input
#### ----------------------------------------
!! test
-Lists: 0. Outside nests
+Lists: 0. Outside nests
!! input
<nowiki>*foo</nowiki>
!!end
!! test
-Lists: 7. Escape bullets in a multi-line context
+Lists: 7. Escape bullets in a multi-line context
!! input
<nowiki>a
*b</nowiki>
#### -----------------------------------
!! test
-HRs: 1. Single line
+HRs: 1. Single line
!! options
disabled
!! input
!! test
2. Link fragments inside <i> and <b>
-(FIXME: Escaping one or both of [[ and ]] is also acceptable --
+(FIXME: Escaping one or both of [[ and ]] is also acceptable --
this is one of the shortcomings of this format)
!! input
''[[foo''<nowiki>]]</nowiki>
/**
* @dataProvider constructorTestProvider
+ * @depends testSave()
*/
public function testRemove( array $data, $loadDefaults ) {
$item = $this->getRowInstance( $data, $loadDefaults );
- $this->assertTrue( $item->save() );
-
$this->assertTrue( $item->remove() );
$this->assertFalse( $item->hasIdField() );
array(
array(
'name' => 'Foobar',
+ 'time' => '20120101020202',
'age' => 42,
'height' => 9000.1,
'awesome' => true,
* @ingroup Test
*
* @group Site
+ * @group Database
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
public function constructorTestProvider() {
$argLists = array();
- $argLists[] = array( 'global_key' => '42' );
+ $argLists[] = array( 'global_key' => 'foo' );
- $argLists[] = array( 'global_key' => '42', 'type' => Site::TYPE_MEDIAWIKI );
+ $argLists[] = array( 'global_key' => 'bar', 'type' => Site::TYPE_MEDIAWIKI );
$constructorArgs = array();
$this->assertEquals( $path, $site->getPath( 'foo' ) );
}
+ public function testProtocolRelativePath() {
+ /* @var SiteObject $site */
+ $site = $this->getRowInstance( $this->getMockFields(), false );
+
+ $type = $site->getLinkPathType();
+ $path = '//acme.com/'; // protocol-relative URL
+ $site->setPath( $type, $path );
+
+ $this->assertEquals( '', $site->getProtocol() );
+ }
+
public function provideGetPageUrl() {
//NOTE: the assumption that the URL is built by replacing $1
// with the urlencoded version of $page