X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiExpandTemplates.php;h=4b74a3d4d9106734e2c083f8c51622fa48948ed1;hb=1ed4c6d1ecb82721eeca570ea7586aca97a84b89;hp=851373d5e329d5ff1255bcaa56737c58470d86bb;hpb=91924febc83c0b8e885021e16b2f4742d90371d2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index 851373d5e3..4b74a3d4d9 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -76,10 +76,6 @@ class ApiExpandTemplates extends ApiBase { $this->addWarning( [ 'apierror-revwrongpage', $rev->getId(), wfEscapeWikiText( $pTitleObj->getPrefixedText() ) ] ); } - } else { - // Consider the title derived from the revid as having - // been provided. - $titleProvided = true; } } @@ -103,9 +99,12 @@ class ApiExpandTemplates extends ApiBase { if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) { $parser->startExternalParse( $titleObj, $options, Parser::OT_PREPROCESS ); $dom = $parser->preprocessToDom( $params['text'] ); + // @phan-suppress-next-line PhanUndeclaredMethodInCallable if ( is_callable( [ $dom, 'saveXML' ] ) ) { + // @phan-suppress-next-line PhanUndeclaredMethod $xml = $dom->saveXML(); } else { + // @phan-suppress-next-line PhanUndeclaredMethod $xml = $dom->__toString(); } if ( isset( $prop['parsetree'] ) ) {