Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -94,18 +94,21 @@ |
95 | 95 | $wgTitle = $titleObj; |
96 | 96 | |
97 | 97 | // If for some reason the "oldid" is actually the current revision, it may be cached |
98 | | - if ( $titleObj->getLatestRevID() === $oldid ) { |
| 98 | + if ( $titleObj->getLatestRevID() == $oldid ) { |
99 | 99 | $p_result = false; |
100 | 100 | $pcache = ParserCache::singleton(); |
| 101 | + |
| 102 | + $articleObj = new Article( $titleObj ); |
| 103 | + |
101 | 104 | if ( $wgEnableParserCache ) { |
102 | | - $p_result = $pcache->get( $titleObj, $popts ); |
| 105 | + $p_result = $pcache->get( $articleObj, $popts ); |
103 | 106 | } |
104 | 107 | if ( !$p_result ) { |
105 | 108 | $text = $rev->getText( Revision::FOR_THIS_USER ); |
106 | 109 | $p_result = $wgParser->parse( $text, $titleObj, $popts ); |
107 | 110 | |
108 | 111 | if ( $wgEnableParserCache ) { |
109 | | - $pcache->save( $p_result, $titleObj, $popts ); |
| 112 | + $pcache->save( $p_result, $articleObj, $popts ); |
110 | 113 | } |
111 | 114 | } |
112 | 115 | } else { |
— | — | @@ -157,7 +160,9 @@ |
158 | 161 | } |
159 | 162 | |
160 | 163 | if ( $this->section !== false ) { |
161 | | - $text = $this->getSectionText( $text, !is_null ( $pageid ) ? 'page id ' . $pageid : $titleObj->getText() ); |
| 164 | + $text = $this->getSectionText( $text, !is_null ( $pageid ) |
| 165 | + ? 'page id ' . $pageid : $titleObj->getText() ); |
| 166 | + |
162 | 167 | $p_result = $wgParser->parse( $text, $titleObj, $popts ); |
163 | 168 | } else { |
164 | 169 | // Try the parser cache first |