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:
Roan Kattouw 2008-01-15 21:09:44 +00:00
parent bd143c2c28
commit 88b441f69a

View file

@ -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';