X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fparser%2FParserOutput.php;h=3480a51f3c3ad7624dee2fe5b087aeaabb554293;hb=5120937028f768749d058aa91dde82a96de0af1c;hp=cfb0c3ec591bb789cbf14b996298a2ea83c689b8;hpb=fb79f30319b9ad2a7eb0f5f4d1668143ec8f963e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index cfb0c3ec59..3480a51f3c 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -211,10 +211,10 @@ class ParserOutput extends CacheTime { */ private $mFlags = []; - /** @var integer|null Assumed rev ID for {{REVISIONID}} if no revision is set */ + /** @var int|null Assumed rev ID for {{REVISIONID}} if no revision is set */ private $mSpeculativeRevId; - /** @var integer Upper bound of expiry based on parse duration */ + /** @var int Upper bound of expiry based on parse duration */ private $mMaxAdaptiveExpiry = INF; const EDITSECTION_REGEX = @@ -223,7 +223,7 @@ class ParserOutput extends CacheTime { // finalizeAdaptiveCacheExpiry() uses TTL = MAX( m * PARSE_TIME + b, MIN_AR_TTL) // Current values imply that m=3933.333333 and b=-333.333333 // See https://www.nngroup.com/articles/website-response-times/ - const PARSE_FAST_SEC = .100; // perceived "fast" page parse + const PARSE_FAST_SEC = 0.100; // perceived "fast" page parse const PARSE_SLOW_SEC = 1.0; // perceived "slow" page parse const FAST_AR_TTL = 60; // adaptive TTL for "fast" pages const SLOW_AR_TTL = 3600; // adaptive TTL for "slow" pages @@ -243,6 +243,7 @@ class ParserOutput extends CacheTime { * return value is suitable for writing back via setText() but is not valid * for display to the user. * + * @return string * @since 1.27 */ public function getRawText() { @@ -258,7 +259,7 @@ class ParserOutput extends CacheTime { global $wgOut, $wgLang; $editsectionPage = Title::newFromText( htmlspecialchars_decode( $m[1] ) ); $editsectionSection = htmlspecialchars_decode( $m[2] ); - $editsectionContent = isset( $m[4] ) ? $m[3] : null; + $editsectionContent = isset( $m[4] ) ? Sanitizer::decodeCharReferences( $m[3] ) : null; if ( !is_object( $editsectionPage ) ) { throw new MWException( "Bad parser output text." ); @@ -291,14 +292,17 @@ class ParserOutput extends CacheTime { } /** - * @param integer $id + * @param int $id * @since 1.28 */ public function setSpeculativeRevIdUsed( $id ) { $this->mSpeculativeRevId = $id; } - /** @since 1.28 */ + /** + * @return int|null + * @since 1.28 + */ public function getSpeculativeRevIdUsed() { return $this->mSpeculativeRevId; } @@ -320,6 +324,7 @@ class ParserOutput extends CacheTime { } /** + * @return array * @since 1.25 */ public function getIndicators() { @@ -382,7 +387,10 @@ class ParserOutput extends CacheTime { return $this->mModuleStyles; } - /** @since 1.23 */ + /** + * @return array + * @since 1.23 + */ public function getJsConfigVars() { return $this->mJsConfigVars; } @@ -471,6 +479,8 @@ class ParserOutput extends CacheTime { } /** + * @param string $id + * @param string $content * @since 1.25 */ public function setIndicator( $id, $content ) { @@ -836,6 +846,8 @@ class ParserOutput extends CacheTime { * @code * $parser->getOutput()->my_ext_foo = '...'; * @endcode + * @param string $name + * @param mixed $value */ public function setProperty( $name, $value ) { $this->mProperties[$name] = $value; @@ -1075,7 +1087,7 @@ class ParserOutput extends CacheTime { /** * Lower the runtime adaptive TTL to at most this value * - * @param integer $ttl + * @param int $ttl * @since 1.28 */ public function updateRuntimeAdaptiveExpiry( $ttl ) {