Skip to content

Commit

Permalink
commit v2.3.1
Browse files Browse the repository at this point in the history
* date: November 23, 2023
* security fix CVE-2023-47511 Cross Site Scripting (XSS) vulnerability ([issue 22](#22) thanks for pointing it out @ramiror)
  • Loading branch information
senlin committed Nov 23, 2023
1 parent c28bf76 commit 486eb6c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![plugin version](https://img.shields.io/wordpress/plugin/v/so-pinyin-slugs.svg)](https://wordpress.org/plugins/so-pinyin-slugs) [![WP compatibility](https://plugintests.com/plugins/so-pinyin-slugs/wp-badge.svg)](https://plugintests.com/plugins/so-pinyin-slugs/latest) [![PHP compatibility](https://plugintests.com/plugins/so-pinyin-slugs/php-badge.svg)](https://plugintests.com/plugins/so-pinyin-slugs/latest)

###### Last updated on August 27, 2023
###### tested up to WP 6.3
###### Last updated on November 23, 2023
###### tested up to WP 6.4
###### Authors: [Pieter Bos](https://github.com/senlin)
###### [Stable Version](https://wordpress.org/plugins/so-pinyin-slugs) (via WordPress Plugins Repository)
###### [Plugin homepage](https://so-wp.com/plugin/pinyin-slugs)
Expand Down Expand Up @@ -75,6 +75,11 @@ This repo is open to _any_ kind of contributions.

## Changelog

### 2.3.1

* date: November 23, 2023
* security fix CVE-2023-47511 Cross Site Scripting (XSS) vulnerability ([issue 22](https://github.com/senlin/pinyin-slugs/issues/22) thanks for pointing it out @ramiror)

### 2.3.0

* date: August 27, 2023
Expand Down
4 changes: 3 additions & 1 deletion admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Render the Plugin options form
* @since 2014.07.29
* @modified 2.1.3
* @modified 2.3.1
*/
function sops_render_form() { ?>

Expand Down Expand Up @@ -48,7 +49,8 @@ function sops_render_form() { ?>
</th>

<td>
<input name="sops_options[slug_length]" type="number" id="slug_length" value="<?php echo $options['slug_length']; ?>" />
<input name="sops_options[slug_length]" type="number" id="slug_length" value="<?php echo esc_attr($options['slug_length']); ?>" /> <!-- Escaping the slug_length Value -->

<p class="description"><?php _e( 'By default the maximum slug length is set to 100 letters; anything over that limit will not be converted. If you want to change this limit, you can do that here.', 'so-pinyin-slugs' ); ?></p>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="<?php echo $options['slug_length']; ?>" />
Expand Down
6 changes: 6 additions & 0 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* and return the slug in Pinyin when true
*
* since version 2.0.0
* @modified 2.3.1
*/

function getPinyinSlug( $strTitle ) {
$strTitle = sanitize_text_field( $strTitle ); // Sanitizing and Validating Input ($strTitle)
// Load Chinese character dictionary
global $dictPinyin;

Expand Down Expand Up @@ -56,6 +58,10 @@ function getPinyinSlug( $strTitle ) {
$strRet = $origStrTitle;
}

// Validate the output
$strRet = preg_replace('/[^A-Za-z0-9-_]/', '', $strRet);

// Return the sanitized slug
return $strRet;
}

9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: senlin
Tags: pinyin, permalinks, slugs, Mandarin, Chinese, traditional, simplified
Requires at least: 4.4
Tested up to: 6.3
Stable tag: 2.3.0
Tested up to: 6.4
Stable tag: 2.3.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -79,6 +79,11 @@ Please open an issue over at [Github](https://github.com/senlin/so-pinyin-slugs/

== Changelog ==

= 2.3.1 =

* date: November 23, 2023
* security fix CVE-2023-47511 Cross Site Scripting (XSS) vulnerability ([issue 22](https://github.com/senlin/pinyin-slugs/issues/22) thanks for pointing it out @ramiror)

= 2.3.0 =

* date: August 27, 2023
Expand Down
4 changes: 2 additions & 2 deletions so-pinyin-slugs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://so-wp.com/plugin/pinyin-slugs
Description: Transforms Simplified or Traditional Chinese character titles into Pinyin to create a permalink friendly slug.
Author: SO WP
Version: 2.3.0
Version: 2.3.1
Author URI: https://so-wp.com
Text Domain: so-pinyin-slugs
*/
Expand Down Expand Up @@ -84,7 +84,7 @@ function init() {
function constants() {

/* Set the version number of the plugin. */
define( 'SOPS_VERSION', '2.3.0' );
define( 'SOPS_VERSION', '2.3.1' );

/* Set constant path to the plugin directory. */
define( 'SOPS_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
Expand Down

0 comments on commit 486eb6c

Please sign in to comment.