1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Don't flag "EXPLAIN" as a write

Summary: These queries are safe to run without a CSRF token, and we need them
for the query analyzer in DarkConsole.

Test Plan: "Analyze Query Plans" works again.

Reviewers: jungejason, nh, tuomaspelkonen, aran

Reviewed By: nh

CC: aran, epriestley, nh

Differential Revision: 895
This commit is contained in:
epriestley 2011-09-04 14:57:33 -07:00
parent ae045a9cf2
commit 628082d427

View file

@ -209,7 +209,7 @@ class AphrontMySQLDatabaseConnection extends AphrontDatabaseConnection {
$this->requireConnection();
// TODO: Do we need to include transactional statements here?
$is_write = !preg_match('/^(SELECT|SHOW)\s/', $raw_query);
$is_write = !preg_match('/^(SELECT|SHOW|EXPLAIN)\s/', $raw_query);
if ($is_write) {
AphrontWriteGuard::willWrite();
}