X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=078de3c601f0bb1f79ffe93fe27864e296a14c93;hp=13d8a3aa0e24a9df50e5490fde0b0026bfb1d36d;hb=5d743b03814d2e36abc45f0d9e048d6390b01084;hpb=13df3d2290ba2836ad14e7de664a2671952c5ddb diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 13d8a3aa0e..078de3c601 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3114,10 +3114,29 @@ class Parser { throw $ex; } - # The interface for parser functions allows for extracting - # flags into the local scope. Extract any forwarded flags - # here. - extract( $result ); + // Extract any forwarded flags + if ( isset( $result['found'] ) ) { + $found = $result['found']; + } + if ( array_key_exists( 'text', $result ) ) { + // a string or null + $text = $result['text']; + } + if ( isset( $result['nowiki'] ) ) { + $nowiki = $result['nowiki']; + } + if ( isset( $result['isHTML'] ) ) { + $isHTML = $result['isHTML']; + } + if ( isset( $result['forceRawInterwiki'] ) ) { + $forceRawInterwiki = $result['forceRawInterwiki']; + } + if ( isset( $result['isChildObj'] ) ) { + $isChildObj = $result['isChildObj']; + } + if ( isset( $result['isLocalObj'] ) ) { + $isLocalObj = $result['isLocalObj']; + } } } @@ -3498,13 +3517,7 @@ class Parser { * @return Revision|bool False if missing */ public static function statelessFetchRevision( Title $title, $parser = false ) { - $pageId = $title->getArticleID(); - $revId = $title->getLatestRevID(); - - $rev = Revision::newKnownCurrent( wfGetDB( DB_REPLICA ), $pageId, $revId ); - if ( $rev ) { - $rev->setTitle( $title ); - } + $rev = Revision::newKnownCurrent( wfGetDB( DB_REPLICA ), $title ); return $rev; } @@ -3868,11 +3881,12 @@ class Parser { } if ( is_array( $output ) ) { - # Extract flags to local scope (to override $markerType) + // Extract flags $flags = $output; $output = $flags[0]; - unset( $flags[0] ); - extract( $flags ); + if ( isset( $flags['markerType'] ) ) { + $markerType = $flags['markerType']; + } } } else { if ( is_null( $attrText ) ) {