mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +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:
parent
716eab82bb
commit
8c0e5e1c58
1 changed files with 2 additions and 0 deletions
|
@ -195,7 +195,9 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
||||||
$inline_content);
|
$inline_content);
|
||||||
if ($inline->getID()) {
|
if ($inline->getID()) {
|
||||||
$inline->setCache($inline_content);
|
$inline->setCache($inline_content);
|
||||||
|
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||||
$inline->save();
|
$inline->save();
|
||||||
|
unset($unguarded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue