Replace some deprecated method calls.
Change-Id: Id4beca7b6821139fcc319c5694917e68668835ee
This commit is contained in:
parent
e6e0d51edf
commit
3d97704f91
6 changed files with 19 additions and 13 deletions
|
|
@ -85,7 +85,7 @@ class FeedUtils {
|
|||
$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
|
||||
);
|
||||
|
|
|
|||
|
|
@ -70,13 +70,14 @@ class UploadFromUrl extends UploadBase {
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,9 +56,12 @@ class ImportSiteScripts extends Maintenance {
|
|||
}
|
||||
|
||||
$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 );
|
||||
|
|
@ -79,7 +82,9 @@ class ImportSiteScripts extends Maintenance {
|
|||
$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 );
|
||||
|
|
|
|||
|
|
@ -57,10 +57,11 @@ class MakeLanguageSpec extends Maintenance {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ class ArticleTablesTest extends MediaWikiLangTestCase {
|
|||
|
||||
$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' );
|
||||
|
|
|
|||
|
|
@ -71,10 +71,9 @@ function wfThumbHandle404() {
|
|||
}
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue