Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 2d0e59d

Browse files
committed
Fix _real_escape() implementation as per WPDB
1 parent 11576c5 commit 2d0e59d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

.github/workflows/wp-tests-phpunit-run.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ const expectedFailures = [
5454
'Tests_DB::test_charset_switched_to_utf8mb4',
5555
'Tests_DB::test_close',
5656
'Tests_DB::test_delete_value_too_long_for_field with data set "too long"',
57-
'Tests_DB::test_escape_and_prepare with data set #0',
58-
'Tests_DB::test_escape_and_prepare with data set #1',
59-
'Tests_DB::test_escape_and_prepare with data set #2',
6057
'Tests_DB::test_has_cap',
6158
'Tests_DB::test_insert_value_too_long_for_field with data set "too long"',
6259
'Tests_DB::test_mysqli_flush_sync',

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public function _real_escape( $data ) {
107107
if ( ! is_scalar( $data ) ) {
108108
return '';
109109
}
110-
return addslashes( $data );
110+
$escaped = addslashes( $data );
111+
return $this->add_placeholder_escape( $escaped );
111112
}
112113

113114
/**

0 commit comments

Comments
 (0)