*/
public $mSubstWords;
# Initialised in constructor
- public $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols;
+ public $mConf, $mExtLinkBracketedRegex, $mUrlProtocols;
+
+ # Initialized in getPreprocessor()
+ /** @var Preprocessor */
+ public $mPreprocessor;
# Cleared with clearState():
/**
*/
global $wgShowHostnames;
- $fname = __METHOD__ . '-' . wfGetCaller();
if ( $clearState ) {
$magicScopeVariable = $this->lock();
*
* @param string $text
* @param bool $isMain
- * @param bool $frame
+ * @param PPFrame|bool $frame
*
* @return string
*/
return $obj->tc_contents;
}
- $req = MWHttpRequest::factory( $url );
+ $req = MWHttpRequest::factory( $url, array(), __METHOD__ );
$status = $req->execute(); // Status object
if ( $status->isOK() ) {
$text = $req->getContent();
/**
* Clean up signature text
*
- * 1) Strip ~~~, ~~~~ and ~~~~~ out of signatures @see cleanSigInSig
+ * 1) Strip 3, 4 or 5 tildes out of signatures @see cleanSigInSig
* 2) Substitute all transclusions
*
* @param string $text
}
/**
- * Strip ~~~, ~~~~ and ~~~~~ out of signatures
+ * Strip 3, 4 or 5 tildes out of signatures.
*
* @param string $text
* @return string Signature text with /~{3,5}/ removed
}
/**
- * @param string $handler
+ * @param MediaHandler $handler
* @return array
*/
public function getImageParams( $handler ) {
return null;
}
- $this->mRevisionObject = Revision::newFromId( $this->mRevisionId );
+ $rev = call_user_func(
+ $this->mOptions->getCurrentRevisionCallback(), $this->getTitle(), $this
+ );
+
+ # If the parse is for a new revision, then the callback should have
+ # already been set to force the object and should match mRevisionId.
+ # If not, try to fetch by mRevisionId for sanity.
+ if ( $rev && $rev->getId() != $this->mRevisionId ) {
+ $rev = Revision::newFromId( $this->mRevisionId );
+ }
+
+ $this->mRevisionObject = $rev;
+
return $this->mRevisionObject;
}
*/
public function getRevisionTimestamp() {
if ( is_null( $this->mRevisionTimestamp ) ) {
-
global $wgContLang;
$revObject = $this->getRevisionObject();