Merge "registration: Improve dependency checking"
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index bd65fb4..c27c89c 100644 (file)
@@ -247,8 +247,9 @@ class DifferenceEngine extends ContextSource {
                Hooks::run( 'DifferenceEngineShowDiffPage', [ $out ] );
 
                if ( !$this->loadRevisionData() ) {
-                       $this->showMissingRevision();
-
+                       if ( Hooks::run( 'DifferenceEngineShowDiffPageMaybeShowMissingRevision', [ $this ] ) ) {
+                               $this->showMissingRevision();
+                       }
                        return;
                }
 
@@ -481,7 +482,7 @@ class DifferenceEngine extends ContextSource {
         *
         * @return string HTML or empty string
         */
-       protected function markPatrolledLink() {
+       public function markPatrolledLink() {
                if ( $this->mMarkPatrolledLink === null ) {
                        $linkInfo = $this->getMarkPatrolledLinkInfo();
                        // If false, there is no patrol link needed/allowed
@@ -1064,7 +1065,7 @@ class DifferenceEngine extends ContextSource {
         *
         * @return string HTML fragment
         */
-       protected function getRevisionHeader( Revision $rev, $complete = '' ) {
+       public function getRevisionHeader( Revision $rev, $complete = '' ) {
                $lang = $this->getLanguage();
                $user = $this->getUser();
                $revtimestamp = $rev->getTimestamp();
@@ -1369,6 +1370,7 @@ class DifferenceEngine extends ContextSource {
 
                if ( $this->mNewRev ) {
                        $this->mNewContent = $this->mNewRev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
+                       Hooks::run( 'DifferenceEngineLoadTextAfterNewContentIsLoaded', [ $this ] );
                        if ( $this->mNewContent === null ) {
                                return false;
                        }
@@ -1395,6 +1397,8 @@ class DifferenceEngine extends ContextSource {
 
                $this->mNewContent = $this->mNewRev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
 
+               Hooks::run( 'DifferenceEngineAfterLoadNewText', [ $this ] );
+
                return true;
        }