diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2013-10-16 17:31:50 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2013-10-16 17:31:50 +0000 |
commit | 1e95602281251ea539ae76d4217d4db1eec07b95 (patch) | |
tree | 4b35fbd31047a0c037c430bec11a44f48df8af85 /thumb.php | |
parent | a2e72ddcf94937cb97fd339f26f18e88a1c39058 (diff) | |
parent | 43d3304ed6502bd78bf989c2c4ce7f8882fe9c66 (diff) | |
download | mediawikicore-1e95602281251ea539ae76d4217d4db1eec07b95.tar.gz mediawikicore-1e95602281251ea539ae76d4217d4db1eec07b95.zip |
Merge "Support rate-limiting thumbnail generation"
Diffstat (limited to 'thumb.php')
-rw-r--r-- | thumb.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/thumb.php b/thumb.php index 4ffefb686c8c..913adc18ecb1 100644 --- a/thumb.php +++ b/thumb.php @@ -304,6 +304,12 @@ function wfStreamThumb( array $params ) { return; } + $user = RequestContext::getMain()->getUser(); + if ( $user->pingLimiter( 'renderfile' ) ) { + wfThumbError( 500, wfMessage( 'actionthrottledtext' ) ); + return; + } + // Thumbnail isn't already there, so create the new thumbnail... try { $thumb = $img->transform( $params, File::RENDER_NOW ); |