Index: trunk/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | parent :: __construct($query, $moduleName, 'rv'); |
43 | 43 | } |
44 | 44 | |
45 | | - private $fld_ids = false, $fld_flags = false, $fld_timestamp = false, |
| 45 | + private $fld_ids = false, $fld_flags = false, $fld_timestamp = false, $fld_size = false, |
46 | 46 | $fld_comment = false, $fld_user = false, $fld_content = false; |
47 | 47 | |
48 | 48 | public function execute() { |
— | — | @@ -83,6 +83,7 @@ |
84 | 84 | $this->fld_flags = $this->addFieldsIf('rev_minor_edit', isset ($prop['flags'])); |
85 | 85 | $this->fld_timestamp = $this->addFieldsIf('rev_timestamp', isset ($prop['timestamp'])); |
86 | 86 | $this->fld_comment = $this->addFieldsIf('rev_comment', isset ($prop['comment'])); |
| 87 | + $this->fld_size = $this->addFieldsIf('rev_len', isset ($prop['size'])); |
87 | 88 | |
88 | 89 | if (isset ($prop['user'])) { |
89 | 90 | $this->addFields('rev_user'); |
— | — | @@ -235,6 +236,10 @@ |
236 | 237 | $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rev_timestamp); |
237 | 238 | } |
238 | 239 | |
| 240 | + if ($this->fld_len && !is_null($row->rev_len)) { |
| 241 | + $vals['size'] = intval($row->rev_len); |
| 242 | + } |
| 243 | + |
239 | 244 | if ($this->fld_comment && !empty ($row->rev_comment)) { |
240 | 245 | $vals['comment'] = $row->rev_comment; |
241 | 246 | } |
— | — | @@ -256,8 +261,9 @@ |
257 | 262 | 'flags', |
258 | 263 | 'timestamp', |
259 | 264 | 'user', |
| 265 | + 'size', |
260 | 266 | 'comment', |
261 | | - 'content' |
| 267 | + 'content', |
262 | 268 | ) |
263 | 269 | ), |
264 | 270 | 'limit' => array ( |