$row->rc_last_oldid, $row->rc_this_oldid,
$timestamp,
($row->rc_deleted & Revision::DELETED_COMMENT)
- ? wfMsgHtml('rev-deleted-comment')
+ ? wfMessage('rev-deleted-comment')->escaped()
: $row->rc_comment,
$actiontext
);
if ( !count( $wgCopyUploadsDomains ) ) {
return true;
}
- $parsedUrl = wfParseUrl( $url );
- if ( !$parsedUrl ) {
+ $uri = new Uri( $url );
+ $parsedDomain = $uri->getHost();
+ if ( $parsedDomain === null ) {
return false;
}
$valid = false;
foreach( $wgCopyUploadsDomains as $domain ) {
- if ( $parsedUrl['host'] === $domain ) {
+ if ( $parsedDomain === $domain ) {
$valid = true;
break;
}
}
$this->output( "Importing $page\n" );
- $url = wfAppendQuery( $baseUrl, array(
+ $uri = new Uri( $baseUrl );
+ $uri->extendQuery( array(
'action' => 'raw',
'title' => "MediaWiki:{$page}" ) );
+ $url = $uri->toString();
+
$text = Http::get( $url );
$wikiPage = WikiPage::factory( $title );
$pages = array();
do {
- $url = wfAppendQuery( $baseUrl, $data );
+ $uri = new Uri( $baseUrl );
+ $uri->extendQuery( $data );
+ $url = $uri->toString();
$strResult = Http::get( $url );
//$result = FormatJson::decode( $strResult ); // Still broken
$result = unserialize( $strResult );
foreach ( self::$keyToTestArgs as $key => $testArgs ) {
foreach ($testArgs as $args) {
// get the raw template, without any transformations
- $template = wfMsgGetKey( $key, /* useDb */ true, $languageCode, /* transform */ false );
+ $template = wfMessage( $key )->inLanguage( $languageCode )->plain();
// get the magic-parsed version with args
$wfMsgExtArgs = array_merge( array( $key, $wfMsgExtOptions ), $args );
+ // @todo FIXME: Use Message class.
$result = call_user_func_array( 'wfMsgExt', $wfMsgExtArgs );
// record the template, args, language, and expected result
$wgLang = Language::factory( 'fr' );
$status = $page->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', 0, false, $user );
- $templates1 = $page->getUsedTemplates();
+ $templates1 = $title->getTemplateLinksFrom();
$wgLang = Language::factory( 'de' );
$page->mPreparedEdit = false; // In order to force the rerendering of the same wikitext
// We need an edit, a purge is not enough to regenerate the tables
$status = $page->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', EDIT_UPDATE, false, $user );
- $templates2 = $page->getUsedTemplates();
+ $templates2 = $title->getTemplateLinksFrom();
$this->assertEquals( $templates1, $templates2 );
$this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
}
# Just get the URI path (REDIRECT_URL/REQUEST_URI is either a full URL or a path)
if ( substr( $uriPath, 0, 1 ) !== '/' ) {
- $bits = wfParseUrl( $uriPath );
- if ( $bits && isset( $bits['path'] ) ) {
- $uriPath = $bits['path'];
- } else {
+ $uri = new Uri( $uriPath );
+ $uriPath = $uri->getPath();
+ if ( $uriPath === null ) {
wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
return;
}