Index: branches/wmf/1.18wmf1/includes/parser/ParserCache.php |
— | — | @@ -220,8 +220,18 @@ |
221 | 221 | // Save the timestamp so that we don't have to load the revision row on view |
222 | 222 | $parserOutput->mTimestamp = $article->getTimestamp(); |
223 | 223 | |
224 | | - $parserOutput->mText .= "\n<!-- Saved in parser cache with key $parserOutputKey and timestamp $now -->\n"; |
| 224 | + // HACK put host name in the parser cache comment --Roan |
| 225 | + $hostname = wfHostname(); |
| 226 | + $parserOutput->mText .= "\n<!-- Saved in parser cache with key $parserOutputKey and timestamp $now generated by $hostname -->\n"; |
225 | 227 | wfDebug( "Saved in parser cache with key $parserOutputKey and timestamp $now\n" ); |
| 228 | + // HACK 2: check for occurrences of bug 31576 |
| 229 | + $templates = $parserOutput->getTemplates(); |
| 230 | + if ( isset( $templates[NS_TEMPLATE] ) ) { |
| 231 | + $badStuff = array_intersect( array( 'PAGENAME', 'FULLPAGENAME', 'NAMESPACE' ), array_keys( $templates[NS_TEMPLATE] ) ); |
| 232 | + if ( $badStuff !== array() ) { |
| 233 | + wfErrorLog( "Bad templates " . implode( ', ', $badStuff ) . " in page [[{$article->getTitle()->getPrefixedText()}]] key $parserOutputKey and timestamp $now generated by $hostname\n", 'udp://10.0.5.8:8420/bug31576' ); |
| 234 | + } |
| 235 | + } |
226 | 236 | |
227 | 237 | // Save the parser output |
228 | 238 | $this->mMemc->set( $parserOutputKey, $parserOutput, $expire ); |