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:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user