X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParserOutput.php;h=23e59115740091a5ecedbabb2b680b05c03b3dd0;hb=3e74b6eeaaf4ad0ce1217d013cca09a3f07cb5c7;hp=c8113f38be413f98f5be734af05daa0125654fd9;hpb=a7c7cfb33404f5bc314a17b95544d90017d8917d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index c8113f38be..23e5911574 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -216,6 +216,9 @@ class ParserOutput extends CacheTime { /** @var int|null Assumed rev timestamp for {{REVISIONTIMESTAMP}} if no revision is set */ private $revisionTimestampUsed; + /** @var string|null SHA-1 base 36 hash of any self-transclusion */ + private $revisionUsedSha1Base36; + /** string CSS classes to use for the wrapping div, stored in the array keys. * If no class is given, no wrapper is added. */ @@ -464,6 +467,33 @@ class ParserOutput extends CacheTime { return $this->revisionTimestampUsed; } + /** + * @param string $hash Lowercase SHA-1 base 36 hash + * @since 1.34 + */ + public function setRevisionUsedSha1Base36( $hash ) { + if ( $hash === null ) { + return; // e.g. RevisionRecord::getSha1() returned null + } + + if ( + $this->revisionUsedSha1Base36 !== null && + $this->revisionUsedSha1Base36 !== $hash + ) { + $this->revisionUsedSha1Base36 = ''; // mismatched + } else { + $this->revisionUsedSha1Base36 = $hash; + } + } + + /** + * @return string|null Lowercase SHA-1 base 36 hash, null if unused, or "" on inconsistency + * @since 1.34 + */ + public function getRevisionUsedSha1Base36() { + return $this->revisionUsedSha1Base36; + } + public function &getLanguageLinks() { return $this->mLanguageLinks; }