Skip to content

Commit e88e665

Browse files
committed
Add a hotfix for Wordfence issue "Call to undefined method WP_SQLite_Driver::prepare()"
1 parent d982450 commit e88e665

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

wp-includes/sqlite/class-wp-sqlite-db.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@ class WP_SQLite_DB extends wpdb {
2020
*/
2121
protected $dbh;
2222

23+
/**
24+
* We don't use mysqli, so it seems reasonable to set this to "false".
25+
* However, this property was originally used for a different purpose:
26+
*
27+
* "Whether to use the mysqli extension over mysql."
28+
*
29+
* The property is not used anymore:
30+
*
31+
* "This is no longer used as the mysql extension is no longer supported."
32+
*
33+
* Hence, it is likely safe to set this to "false". Doing so fixes a Wordfence
34+
* issue by hinting that we're not using mysqli. For more details, see:
35+
*
36+
* https://github.com/WordPress/sqlite-database-integration/issues/284
37+
*
38+
* @var bool
39+
*/
40+
private $use_mysqli = false;
41+
2342
/**
2443
* Backward compatibility, see wpdb::$allow_unsafe_unquoted_parameters.
2544
*

0 commit comments

Comments
 (0)