1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Turn off write guard when saving differential comment cache

Summary:
It is possible to view a comment that has no cache; when viewing such a comment
the request doesn't have a csrf token and there is no need for one, so we turn
off the write guard.

Test Plan:
loaded an old diff that had no cache, and the page loaded instead of throwing
an AphrontCSRFException.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: 858
This commit is contained in:
Nicholas Harper 2011-08-25 15:17:12 -07:00
parent 716eab82bb
commit 8c0e5e1c58

View file

@ -195,7 +195,9 @@ final class DifferentialRevisionCommentView extends AphrontView {
$inline_content);
if ($inline->getID()) {
$inline->setCache($inline_content);
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
$inline->save();
unset($unguarded);
}
}
}