Changeset 3488995
- Timestamp:
- 03/23/2026 12:35:28 PM (5 days ago)
- Location:
- dfx-parish-retreat-letters/trunk
- Files:
-
- 4 edited
-
dfx-parish-retreat-letters.php (modified) (2 diffs)
-
includes/class-retreat.php (modified) (2 diffs)
-
languages/dfx-parish-retreat-letters.pot (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dfx-parish-retreat-letters/trunk/dfx-parish-retreat-letters.php
r3488281 r3488995 4 4 * Plugin URI: https://github.com/davefx/dfx-parish-retreat-letters 5 5 * Description: A WordPress plugin for managing parish retreat letters. 6 * Version: 26.03.2 26 * Version: 26.03.23 7 7 * Author: David Marín Carreño 8 8 * Author URI: https://davefx.com … … 28 28 */ 29 29 if ( ! defined( 'DFXPRL_VERSION' ) ) { 30 define( 'DFXPRL_VERSION', '26.03.2 2' );30 define( 'DFXPRL_VERSION', '26.03.23' ); 31 31 } 32 32 -
dfx-parish-retreat-letters/trunk/includes/class-retreat.php
r3488281 r3488995 311 311 'custom_header_block_id' => $this->sanitize_block_selection( $data['custom_header_block_id'] ?? null ), 312 312 'custom_footer_block_id' => $this->sanitize_block_selection( $data['custom_footer_block_id'] ?? null ), 313 'body_classes' => sanitize_text_field( $data['body_classes'] ?? '' ),313 'body_classes' => $this->sanitize_class_list( $data['body_classes'] ?? '' ), 314 314 'notes_enabled' => isset( $data['notes_enabled'] ) ? (int) (bool) $data['notes_enabled'] : 0, 315 315 'internal_notes_enabled' => isset( $data['internal_notes_enabled'] ) ? (int) (bool) $data['internal_notes_enabled'] : 0, … … 351 351 352 352 /** 353 * Sanitize a space-separated list of CSS class names. 354 * 355 * Strips any characters that are not valid in a CSS class name 356 * (only allows A-Z, a-z, 0-9, hyphens, and underscores per class token). 357 * 358 * @since 1.0.0 359 * @param string $classes Space-separated CSS class names. 360 * @return string Sanitized space-separated CSS class names. 361 */ 362 private function sanitize_class_list( $classes ) { 363 if ( empty( $classes ) ) { 364 return ''; 365 } 366 367 $class_list = preg_split( '/\s+/', trim( (string) $classes ), -1, PREG_SPLIT_NO_EMPTY ); 368 $sanitized = array(); 369 370 foreach ( $class_list as $class ) { 371 // Remove percent-encoded octets. 372 $class = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class ); 373 // Only allow characters valid in CSS class names. 374 $class = preg_replace( '/[^A-Za-z0-9_-]/', '', $class ); 375 if ( '' !== $class ) { 376 $sanitized[] = $class; 377 } 378 } 379 380 return implode( ' ', $sanitized ); 381 } 382 383 /** 353 384 * Validate retreat data. 354 385 * -
dfx-parish-retreat-letters/trunk/languages/dfx-parish-retreat-letters.pot
r3488281 r3488995 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: DFX Parish Retreat Letters 26.03.2 2\n"5 "Project-Id-Version: DFX Parish Retreat Letters 26.03.23\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/dfx-parish-retreat-letters\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
dfx-parish-retreat-letters/trunk/readme.txt
r3488335 r3488995 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 26.03.2 26 Stable tag: 26.03.23 7 7 Requires PHP: 7.4 8 8 License: GPLv3 or later … … 174 174 175 175 ## Changelog 176 177 ### 26.03.23 178 179 - Fix: `body_classes` field now stores only a list of CSS class names instead of arbitrary CSS, with sanitization enforcing valid class-name characters only. 176 180 177 181 ### 26.03.22
Note: See TracChangeset
for help on using the changeset viewer.