From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/parser/ParserOptions.php | 86 ++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 50 deletions(-) (limited to 'includes/parser/ParserOptions.php') diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 009b18a1..3eb83e36 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -29,67 +29,62 @@ * @ingroup Parser */ class ParserOptions { - - /** - * Use DateFormatter to format dates - */ - var $mUseDynamicDates; - + /** * Interlanguage links are removed and returned in an array */ var $mInterwikiMagic; - + /** * Allow external images inline? */ var $mAllowExternalImages; - + /** * If not, any exception? */ var $mAllowExternalImagesFrom; - + /** * If not or it doesn't match, should we check an on-wiki whitelist? */ var $mEnableImageWhitelist; - + /** * Date format index */ var $mDateFormat = null; - + /** * Create "edit section" links? */ var $mEditSection = true; - + /** * Allow inclusion of special pages? */ var $mAllowSpecialInclusion; - + /** * Use tidy to cleanup output HTML? */ var $mTidy = false; - + /** * Which lang to call for PLURAL and GRAMMAR */ var $mInterfaceMessage = false; - + /** * Overrides $mInterfaceMessage with arbitrary language */ var $mTargetLanguage = null; - + /** * Maximum size of template expansions, in bytes */ var $mMaxIncludeSize; - + /** * Maximum number of nodes touched by PPFrame::expand() */ @@ -99,56 +94,56 @@ class ParserOptions { * Maximum number of nodes generated by Preprocessor::preprocessToObj() */ var $mMaxGeneratedPPNodeCount; - + /** * Maximum recursion depth in PPFrame::expand() */ var $mMaxPPExpandDepth; - + /** * Maximum recursion depth for templates within templates */ var $mMaxTemplateDepth; - + /** * Maximum number of calls per parse to expensive parser functions */ var $mExpensiveParserFunctionLimit; - + /** * Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS */ var $mRemoveComments = true; - + /** * Callback for template fetching. Used as first argument to call_user_func(). */ var $mTemplateCallback = array( 'Parser', 'statelessFetchTemplate' ); - + /** * Enable limit report in an HTML comment on output */ var $mEnableLimitReport = false; - + /** * Timestamp used for {{CURRENTDAY}} etc. */ var $mTimestamp; - + /** * Target attribute for external links */ var $mExternalLinkTarget; - + /** - * Clean up signature texts? + * Clean up signature texts? * * 1) Strip ~~~, ~~~~ and ~~~~~ out of signatures * 2) Substitute all transclusions */ var $mCleanSignatures; - + /** * Transform wiki markup when saving the page? */ @@ -168,43 +163,43 @@ class ParserOptions { * Automatically number headings? */ var $mNumberHeadings; - + /** * User math preference (as integer). Not used (1.19) */ var $mMath; - + /** * Thumb size preferred by the user. */ var $mThumbSize; - + /** * Maximum article size of an article to be marked as "stub" */ private $mStubThreshold; - + /** * Language object of the User language. */ var $mUserLang; /** - * @var User + * @var User * Stored user object */ var $mUser; - + /** * Parsing the page for a "preview" operation? */ var $mIsPreview = false; - + /** * Parsing the page for a "preview" operation on a single section? */ var $mIsSectionPreview = false; - + /** * Parsing the printable version of the page? */ @@ -220,7 +215,6 @@ class ParserOptions { */ protected $onAccessCallback = null; - function getUseDynamicDates() { return $this->mUseDynamicDates; } function getInterwikiMagic() { return $this->mInterwikiMagic; } function getAllowExternalImages() { return $this->mAllowExternalImages; } function getAllowExternalImagesFrom() { return $this->mAllowExternalImagesFrom; } @@ -308,7 +302,6 @@ class ParserOptions { return $this->getUserLangObj()->getCode(); } - function setUseDynamicDates( $x ) { return wfSetVar( $this->mUseDynamicDates, $x ); } function setInterwikiMagic( $x ) { return wfSetVar( $this->mInterwikiMagic, $x ); } function setAllowExternalImages( $x ) { return wfSetVar( $this->mAllowExternalImages, $x ); } function setAllowExternalImagesFrom( $x ) { return wfSetVar( $this->mAllowExternalImagesFrom, $x ); } @@ -415,14 +408,14 @@ class ParserOptions { return new ParserOptions( $context->getUser(), $context->getLanguage() ); } - /** - * Get user options + /** + * Get user options * * @param $user User object * @param $lang Language object */ private function initialiseFromUser( $user, $lang ) { - global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages, + global $wgInterwikiMagic, $wgAllowExternalImages, $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize, $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit, @@ -430,7 +423,6 @@ class ParserOptions { wfProfileIn( __METHOD__ ); - $this->mUseDynamicDates = $wgUseDynamicDates; $this->mInterwikiMagic = $wgInterwikiMagic; $this->mAllowExternalImages = $wgAllowExternalImages; $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom; @@ -481,12 +473,7 @@ class ParserOptions { * @return array */ public static function legacyOptions() { - global $wgUseDynamicDates; - $legacyOpts = array( 'math', 'stubthreshold', 'numberheadings', 'userlang', 'thumbsize', 'editsection', 'printable' ); - if ( $wgUseDynamicDates ) { - $legacyOpts[] = 'dateformat'; - } - return $legacyOpts; + return array( 'math', 'stubthreshold', 'numberheadings', 'userlang', 'thumbsize', 'editsection', 'printable' ); } /** @@ -518,14 +505,13 @@ class ParserOptions { $confstr .= '*'; } - // Space assigned for the stubthreshold but unused // since it disables the parser cache, its value will always // be 0 when this function is called by parsercache. if ( in_array( 'stubthreshold', $forOptions ) ) { $confstr .= '!' . $this->mStubThreshold; } else { - $confstr .= '!*' ; + $confstr .= '!*'; } if ( in_array( 'dateformat', $forOptions ) ) { -- cgit v1.2.2