Limiting image history listings to 500 for now. A hard-coded limit sucks, but an alternative isn't really available as the File handling code doesn't allow it (see also bug 12645). Besides, very few image histories are that long.
This commit is contained in:
parent
bd143c2c28
commit
88b441f69a
1 changed files with 6 additions and 0 deletions
|
|
@ -68,7 +68,13 @@ class ApiQueryImageInfo extends ApiQueryBase {
|
|||
$repository = $img->getRepoName();
|
||||
|
||||
$isCur = true;
|
||||
$count = 0;
|
||||
while($line = $img->nextHistoryLine()) { // assignment
|
||||
# FIXME: Limiting to 500 because it's unlimited right now
|
||||
# 500+ image histories are scarce, but this has DoS potential
|
||||
# FileRepo.php should be fixed
|
||||
if($count++ == 500)
|
||||
break;
|
||||
$row = get_object_vars( $line );
|
||||
$vals = array();
|
||||
$prefix = $isCur ? 'img' : 'oi';
|
||||
|
|
|
|||
Loading…
Reference in a new issue