Skip to content

Commit 9f0026a

Browse files
committed
Fixed: shortcodes prefix field now accepts special characters
1 parent aaae6d3 commit 9f0026a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

admin/class-shortcodes-ultimate-admin-settings.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ protected function get_plugin_settings() {
209209

210210
$this->plugin_settings[] = array(
211211
'id' => 'su_option_prefix',
212-
'sanitize' => 'sanitize_html_class',
212+
'sanitize' => array( $this, 'sanitize_prefix' ),
213213
'title' => __( 'Shortcodes prefix', 'shortcodes-ultimate' ),
214214
'description' => __( 'This prefix will be used in shortcode names. For example: set <code>MY_</code> prefix and shortcodes will look like <code>[MY_button]</code>. Please note that this setting does not change shortcodes that have been inserted earlier. Change this setting very carefully.', 'shortcodes-ultimate' ),
215215
);
@@ -228,4 +228,15 @@ protected function get_plugin_settings() {
228228

229229
}
230230

231+
/**
232+
* Callback function to sanitize prefix value.
233+
*
234+
* @since 5.0.1
235+
* @param string $prefix Prefix value.
236+
* @return string Sanitized string.
237+
*/
238+
public function sanitize_prefix( $prefix ) {
239+
return preg_replace( '@[<>&/\[\]\x00-\x20="\']@', '', $prefix );
240+
}
241+
231242
}

0 commit comments

Comments
 (0)