diff options
Diffstat (limited to 'includes/SquidUpdate.php')
-rw-r--r-- | includes/SquidUpdate.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php index c8497a83..b1f01924 100644 --- a/includes/SquidUpdate.php +++ b/includes/SquidUpdate.php @@ -52,13 +52,17 @@ class SquidUpdate { return new SquidUpdate( $blurlArr ); } - static function newFromTitles( &$titles, $urlArr = array() ) { + /** + * Create a SquidUpdate from an array of Title objects, or a TitleArray object + */ + static function newFromTitles( $titles, $urlArr = array() ) { global $wgMaxSquidPurgeTitles; - if ( count( $titles ) > $wgMaxSquidPurgeTitles ) { - $titles = array_slice( $titles, 0, $wgMaxSquidPurgeTitles ); - } + $i = 0; foreach ( $titles as $title ) { $urlArr[] = $title->getInternalURL(); + if ( $i++ > $wgMaxSquidPurgeTitles ) { + break; + } } return new SquidUpdate( $urlArr ); } |