Merge "Get to the point about howto download Vector :p"
[lhc/web/wiklou.git] / includes / content / AbstractContent.php
index 683c959..816572c 100644 (file)
@@ -446,7 +446,7 @@ abstract class AbstractContent implements Content {
                $lossy = ( $lossy === 'lossy' ); // string flag, convert to boolean for convenience
                $result = false;
 
-               wfRunHooks( 'ConvertContent', array( $this, $toModel, $lossy, &$result ) );
+               Hooks::run( 'ConvertContent', array( $this, $toModel, $lossy, &$result ) );
 
                return $result;
        }
@@ -480,12 +480,19 @@ abstract class AbstractContent implements Content {
 
                $po = new ParserOutput();
 
-               if ( wfRunHooks( 'ContentGetParserOutput',
+               if ( Hooks::run( 'ContentGetParserOutput',
                        array( $this, $title, $revId, $options, $generateHtml, &$po ) ) ) {
 
+                       // Save and restore the old value, just in case something is reusing
+                       // the ParserOptions object in some weird way.
+                       $oldRedir = $options->getRedirectTarget();
+                       $options->setRedirectTarget( $this->getRedirectTarget() );
                        $this->fillParserOutput( $title, $revId, $options, $generateHtml, $po );
+                       $options->setRedirectTarget( $oldRedir );
                }
 
+               Hooks::run( 'ContentAlterParserOutput', array( $this, $title, $po ) );
+
                return $po;
        }