|
3 | 3 | * Plugin Name: CloudScale Code Block |
4 | 4 | * Plugin URI: https://andrewbaker.ninja |
5 | 5 | * Description: Syntax highlighted code block with auto language detection, clipboard copy, dark/light mode toggle, code block migrator, and read only SQL query tool. Works as a Gutenberg block and as a [cs_code] shortcode. |
6 | | - * Version: 1.7.19 |
| 6 | + * Version: 1.7.21 |
7 | 7 | * Author: Andrew Baker |
8 | 8 | * Author URI: https://andrewbaker.ninja |
9 | 9 | * License: GPL-2.0-or-later |
|
31 | 31 | */ |
32 | 32 | class CloudScale_Code_Block { |
33 | 33 |
|
34 | | - const VERSION = '1.7.19'; |
| 34 | + const VERSION = '1.7.21'; |
35 | 35 | const HLJS_VERSION = '11.11.1'; |
36 | 36 | const HLJS_CDN = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/'; |
37 | 37 | const TOOLS_SLUG = 'cloudscale-code-sql'; |
@@ -952,7 +952,7 @@ public static function ajax_sql_run(): void { |
952 | 952 | wp_send_json_error( 'Bad nonce', 403 ); |
953 | 953 | } |
954 | 954 |
|
955 | | - $raw = isset( $_POST['sql'] ) ? $_POST['sql'] : ''; |
| 955 | + $raw = isset( $_POST['sql'] ) ? $_POST['sql'] : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- raw SQL for admin tool; unslashed on next line, validated via is_safe_query() |
956 | 956 | $sql = trim( wp_unslash( $raw ) ); |
957 | 957 | if ( ! $sql ) { |
958 | 958 | wp_send_json_error( 'Empty query' ); |
@@ -1304,7 +1304,7 @@ public static function ajax_preview() { |
1304 | 1304 | wp_send_json_error( 'Bad nonce', 403 ); |
1305 | 1305 | } |
1306 | 1306 |
|
1307 | | - $post_id = (int) ( $_POST['post_id'] ?? 0 ); |
| 1307 | + $post_id = (int) ( $_POST['post_id'] ?? 0 ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- sanitised via (int) cast |
1308 | 1308 | $post = get_post( $post_id ); |
1309 | 1309 |
|
1310 | 1310 | if ( ! $post ) { |
@@ -1336,7 +1336,7 @@ public static function ajax_migrate_single() { |
1336 | 1336 | wp_send_json_error( 'Bad nonce', 403 ); |
1337 | 1337 | } |
1338 | 1338 |
|
1339 | | - $post_id = (int) ( $_POST['post_id'] ?? 0 ); |
| 1339 | + $post_id = (int) ( $_POST['post_id'] ?? 0 ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- sanitised via (int) cast |
1340 | 1340 | $post = get_post( $post_id ); |
1341 | 1341 |
|
1342 | 1342 | if ( ! $post ) { |
|
0 commit comments