Skip to content

Commit 754d53d

Browse files
authored
Fixed issue where slugs in settings no longer supported a forward slash.
1 parent a3bdf78 commit 754d53d

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

includes/class-cpt.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,19 @@ public static function register_taxonomies() {
198198
apply_filters( 'wzkb_tag_args', $args )
199199
);
200200
}
201+
202+
/**
203+
* Sanitize slug but retain slashes.
204+
*
205+
* @since 2.3.3
206+
*
207+
* @param string $slug Raw slug input.
208+
* @return string Sanitized slug with slashes retained.
209+
*/
210+
public static function sanitize_slug_with_slashes( $slug ) {
211+
$parts = explode( '/', $slug );
212+
$sanitized_parts = array_map( 'sanitize_title', $parts );
213+
214+
return implode( '/', $sanitized_parts );
215+
}
201216
}

knowledgebase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Plugin Name: WebberZone Knowledge Base
1414
* Plugin URI: https://github.com/WebberZone/knowledgebase
1515
* Description: Create a multi-product knowledge base on your WordPress site.
16-
* Version: 2.3.2
16+
* Version: 2.3.3
1717
* Author: WebberZone
1818
* Author URI: https://webberzone.com
1919
* License: GPL-2.0+
@@ -37,7 +37,7 @@
3737
*
3838
* @var string $wzkb_version Plugin version
3939
*/
40-
define( 'WZKB_VERSION', '2.3.2' );
40+
define( 'WZKB_VERSION', '2.3.3' );
4141
}
4242

4343
if ( ! defined( 'WZKB_PLUGIN_DIR' ) ) {

readme.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,16 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
113113

114114
== Upgrade Notice ==
115115

116-
= 2.3.2 =
117-
Fixed security issue where Knowledge Base slug in settings was not sanitized.
116+
= 2.3.3 =
117+
Fixed issue where slugs in settings no longer supported a forward slash.
118118

119119
== Changelog ==
120120

121+
= 2.3.3 =
122+
123+
* Bug fixes:
124+
* Fixed issue where slugs in settings no longer supported a forward slash.
125+
121126
= 2.3.2 =
122127

123128
* Bug fixes:

0 commit comments

Comments
 (0)