Skip to content

Commit

Permalink
Avoid matching in a word in is_write_query() (#95)
Browse files Browse the repository at this point in the history
Co-authored-by: John James Jacoby <johnjamesjacoby@me.com>
  • Loading branch information
takotakot and JJJ authored Nov 21, 2020
1 parent 3bd9160 commit dc3167b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ludicrousdb/includes/class-ludicrousdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public function is_write_query( $q = '' ) {
$q = ltrim( $q, "\r\n\t (" );

// Possible writes
if ( preg_match( '/(?:ALTER|CREATE|ANALYZE|CHECK|OPTIMIZE|REPAIR|CALL|DELETE|DROP|INSERT|LOAD|REPLACE|UPDATE|SET|RENAME)(?:\s|$)/i', $q ) ) {
if ( preg_match( '/(?:^|\s)(?:ALTER|CREATE|ANALYZE|CHECK|OPTIMIZE|REPAIR|CALL|DELETE|DROP|INSERT|LOAD|REPLACE|UPDATE|SET|RENAME\s+TABLE)(?:\s|$)/i', $q ) ) {
return true;
}

Expand Down

0 comments on commit dc3167b

Please # to comment.