Skip to content

Commit 0d0ed13

Browse files
committed
Reviewed SQL sanitization
1 parent 924f5a4 commit 0d0ed13

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

core/Datastore/Meta_Datastore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ public function delete( Field $field ) {
7171
);
7272
$storage_key_comparisons = $this->key_toolset->storage_key_patterns_to_sql( '`meta_key`', $storage_key_patterns );
7373

74+
// @codingStandardsIgnoreStart sanitized in `storage_key_patterns_to_sql`
7475
$meta_keys = $wpdb->get_col( '
7576
SELECT `meta_key`
7677
FROM `' . $this->get_table_name() . '`
7778
WHERE `' . $this->get_table_field_name() . '` = ' . intval( $this->get_object_id() ) . '
7879
AND ' . $storage_key_comparisons . '
7980
' );
81+
// @codingStandardsIgnoreEnd
8082

8183
foreach ( $meta_keys as $meta_key ) {
8284
delete_metadata( $this->get_meta_type(), $this->get_object_id(), $meta_key );

core/Datastore/Term_Meta_Datastore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public static function create_table() {
4949
$charset_collate .= ' COLLATE ' . $wpdb->collate;
5050
}
5151

52+
// @codingStandardsIgnoreStart sanitized above.
5253
$wpdb->query( 'CREATE TABLE ' . $wpdb->prefix . 'termmeta (
5354
meta_id bigint(20) unsigned NOT NULL auto_increment,
5455
term_id bigint(20) unsigned NOT NULL default "0",
@@ -58,6 +59,7 @@ public static function create_table() {
5859
KEY term_id (term_id),
5960
KEY meta_key (meta_key)
6061
) ' . $charset_collate . ';' );
62+
// @codingStandardsIgnoreEnd
6163
}
6264

6365
/**

core/Datastore/Theme_Options_Datastore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ public function delete( Field $field ) {
116116
);
117117
$storage_key_comparisons = $this->key_toolset->storage_key_patterns_to_sql( '`option_name`', $storage_key_patterns );
118118

119+
// @codingStandardsIgnoreStart sanitized in `storage_key_patterns_to_sql`
119120
$option_names = $wpdb->get_col( '
120121
SELECT `option_name`
121122
FROM `' . $wpdb->options . '`
122123
WHERE ' . $storage_key_comparisons . '
123124
' );
125+
// @codingStandardsIgnoreEnd
124126

125127
foreach ( $option_names as $option_name ) {
126128
delete_option( $option_name );

core/Libraries/Sidebar_Manager/Sidebar_Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function action_handler() {
3838
'data' => null,
3939
);
4040

41-
$input = stripslashes_deep( $_POST );
41+
$input = stripslashes_deep( $_POST ); // CSRF ok. verfied below.
4242
$action = isset( $input['action'] ) ? $input['action'] : '';
4343
$nonce = isset( $input['nonce'] ) ? $input['nonce'] : '';
4444

0 commit comments

Comments
 (0)