From: Brad Jorsch Date: Wed, 22 Nov 2017 20:12:43 +0000 (-0500) Subject: Deprecate OutputPage::parserOptions() as a setter X-Git-Tag: 1.31.0-rc.0~1426^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=cfc57f374c9b71dc6ffe920c320942fae0631ccc Deprecate OutputPage::parserOptions() as a setter The only known callers were using it to call ->setEditSections( false ), which has been the default since MediaWiki 1.19. Change-Id: Ib021d7e80e44782ba6ebe66cf8366bae9147ce00 Depends-On: I7de0102e6cac6b5aa0147b825fa2cb6ebd37b434 Depends-On: I7b0604773a8692c7cb37fffa3fcb8aaac83d81ba --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 5f91df67c9..3de0e17586 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -104,6 +104,7 @@ changes to languages because of Phabricator reports. DifferenceEngine::MW_DIFF_VERSION should be used instead. * Use of Maintenance::error( $err, $die ) to exit script was deprecated. Use Maintenance::fatalError() instead. +* Passing a ParserOptions object to OutputPage::parserOptions() is deprecated. == Compatibility == MediaWiki 1.31 requires PHP 5.5.9 or later. There is experimental support for diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4635f991c2..a5f9c18151 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1573,10 +1573,14 @@ class OutputPage extends ContextSource { * Get/set the ParserOptions object to use for wikitext parsing * * @param ParserOptions|null $options Either the ParserOption to use or null to only get the - * current ParserOption object + * current ParserOption object. This parameter is deprecated since 1.31. * @return ParserOptions */ public function parserOptions( $options = null ) { + if ( $options !== null ) { + wfDeprecated( __METHOD__ . ' with non-null $options', '1.31' ); + } + if ( $options !== null && !empty( $options->isBogus ) ) { // Someone is trying to set a bogus pre-$wgUser PO. Check if it has // been changed somehow, and keep it if so.