Skip to content

Commit e7709af

Browse files
committed
Database: Add NO_BACKSLASH_ESCAPES to wpdb::$incompatible_modes.
When `NO_BACKSLASH_ESCAPES` is on, MySQL treats the backslash as a normal character instead of an escape character. WordPress relies on backslash escaping, so queries with escaped values can fail. `wpdb::set_sql_mode()` now removes this mode from the session, as it already does for the other incompatible modes. Sites that need the mode can still allow it with the `incompatible_sql_modes` filter. Includes an update to `test_set_incompatible_sql_mode()` to cover the new mode. Developed in WordPress/wordpress-develop#13758. Props tyxla, mcsf, therssoftware. Fixes #66185. Built from https://develop.svn.wordpress.org/trunk@64240 git-svn-id: http://core.svn.wordpress.org/trunk@63391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 8588e2e commit e7709af

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎wp-includes/class-wpdb.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ class wpdb {
638638
* A list of incompatible SQL modes.
639639
*
640640
* @since 3.9.0
641+
* @since 7.2.0 Added `NO_BACKSLASH_ESCAPES`.
641642
*
642643
* @var string[]
643644
*/
@@ -648,6 +649,7 @@ class wpdb {
648649
'STRICT_ALL_TABLES',
649650
'TRADITIONAL',
650651
'ANSI',
652+
'NO_BACKSLASH_ESCAPES',
651653
);
652654

653655
/**

‎wp-includes/version.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.2-alpha-64239';
19+
$wp_version = '7.2-alpha-64240';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)