Index: trunk/phase3/includes/Article.php |
— | — | @@ -228,6 +228,21 @@ |
229 | 229 | return $this->mContent; |
230 | 230 | } |
231 | 231 | } |
| 232 | + |
| 233 | + /** |
| 234 | + * Get the text of the current revision. No side-effects... |
| 235 | + * |
| 236 | + * @return Return the text of the current revision |
| 237 | + */ |
| 238 | + public function getRawText() { |
| 239 | + // Check process cache for current revision |
| 240 | + if( $this->mContentLoaded && $this->mOldId == 0 ) { |
| 241 | + return $this->mContent; |
| 242 | + } |
| 243 | + $rev = Revision::newFromTitle( $this->mTitle ); |
| 244 | + $text = $rev ? $rev->getRawText() : false; |
| 245 | + return $text; |
| 246 | + } |
232 | 247 | |
233 | 248 | /** |
234 | 249 | * This function returns the text of a section, specified by a number ($section). |
— | — | @@ -1128,7 +1143,7 @@ |
1129 | 1144 | if( $this->getID() == 0 ) { |
1130 | 1145 | $text = false; |
1131 | 1146 | } else { |
1132 | | - $text = $this->getContent(); |
| 1147 | + $text = $this->getRawText(); |
1133 | 1148 | } |
1134 | 1149 | $wgMessageCache->replace( $this->mTitle->getDBkey(), $text ); |
1135 | 1150 | } |
— | — | @@ -1490,7 +1505,7 @@ |
1491 | 1506 | $isminor = ( $flags & EDIT_MINOR ) && $user->isAllowed('minoredit'); |
1492 | 1507 | $bot = $flags & EDIT_FORCE_BOT; |
1493 | 1508 | |
1494 | | - $oldtext = $this->getContent(); |
| 1509 | + $oldtext = $this->getRawText(); // current revision |
1495 | 1510 | $oldsize = strlen( $oldtext ); |
1496 | 1511 | |
1497 | 1512 | # Provide autosummaries if one is not provided and autosummaries are enabled. |
— | — | @@ -2398,7 +2413,7 @@ |
2399 | 2414 | return false; |
2400 | 2415 | } |
2401 | 2416 | |
2402 | | - $u = new SiteStatsUpdate( 0, 1, -(int)$this->isCountable( $this->getContent() ), -1 ); |
| 2417 | + $u = new SiteStatsUpdate( 0, 1, -(int)$this->isCountable( $this->getRawText() ), -1 ); |
2403 | 2418 | array_push( $wgDeferredUpdateList, $u ); |
2404 | 2419 | |
2405 | 2420 | // Bitfields to further suppress the content |