Skip to content

Commit 628082d

Browse files
author
epriestley
committed
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
1 parent ae045a9 commit 628082d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/storage/connection/mysql/AphrontMySQLDatabaseConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function executeRawQuery($raw_query) {
209209
$this->requireConnection();
210210

211211
// TODO: Do we need to include transactional statements here?
212-
$is_write = !preg_match('/^(SELECT|SHOW)\s/', $raw_query);
212+
$is_write = !preg_match('/^(SELECT|SHOW|EXPLAIN)\s/', $raw_query);
213213
if ($is_write) {
214214
AphrontWriteGuard::willWrite();
215215
}

0 commit comments

Comments
 (0)