+
+ $revLength = strlen( $text );
+ if ( $wgContentHandlerUseDB ) {
+ $row = $this->db->selectRow( 'revision', array( 'rev_len', 'rev_content_model' ), array( 'rev_id' => $revID ), __METHOD__ );
+ if ( $row ) {
+ // only check the length for the wikitext content handler,
+ // it's a wasted (and failed) check otherwise
+ if ( $row->rev_content_model == CONTENT_MODEL_WIKITEXT ) {
+ $revLength = $row->rev_len;
+ }
+ }
+
+ }
+ else {
+ $revLength = $this->db->selectField( 'revision', 'rev_len', array( 'rev_id' => $revID ) );
+ }
+