From b291ad9807260f98e00f6e896457660c195b8b4e Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 17 Aug 2011 14:39:00 -0700 Subject: [PATCH] Unguard thumbnail generation from CSRF. --- .../transform/PhabricatorFileTransformController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/files/controller/transform/PhabricatorFileTransformController.php b/src/applications/files/controller/transform/PhabricatorFileTransformController.php index c2b777233d..2929374ba4 100644 --- a/src/applications/files/controller/transform/PhabricatorFileTransformController.php +++ b/src/applications/files/controller/transform/PhabricatorFileTransformController.php @@ -49,6 +49,10 @@ class PhabricatorFileTransformController extends PhabricatorFileController { return $this->buildDefaultTransformation($file); } + // We're essentially just building a cache here and don't need CSRF + // protection. + $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); + switch ($this->transform) { case 'thumb-160x120': $xformed_file = $this->executeThumbTransform($file, 160, 120);