From 6de8cd186d7ce8b842f78aab6daba20b1a7db4b1 Mon Sep 17 00:00:00 2001 From: David Artiss Date: Thu, 16 Nov 2023 19:28:40 +0000 Subject: [PATCH] Version 2.3.8 --- includes/add-embeds.php | 5 ++++- readme.txt | 9 ++++++--- simple-code-embed.php | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/includes/add-embeds.php b/includes/add-embeds.php index b192bcd..0e7c3a7 100644 --- a/includes/add-embeds.php +++ b/includes/add-embeds.php @@ -133,12 +133,15 @@ function ce_quick_replace( $content = '', $options = '', $search = '' ) { $start_pos = strpos( $content, $options['opening_ident'] . $search, 0 ); + $open_len = strlen( $options['opening_ident'] ); + $close_len = strlen( $options['closing_ident'] ); + while ( false !== $start_pos ) { $end_pos = strpos( $content, $options['closing_ident'], $start_pos + 1 ); if ( false !== $end_pos ) { - $url = substr( $content, $start_pos + 2, $end_pos - $start_pos - 2 ); + $url = substr( $content, $start_pos + $open_len, $end_pos - $start_pos - $close_len ); $file = ce_get_file( $url ); if ( false !== $file ) { $content = str_replace( $options['opening_ident'] . $url . $options['closing_ident'], $file, $content ); diff --git a/readme.txt b/readme.txt index d5cb3a2..a7f55fd 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: code, embed, html, css, javascript, script Requires at least: 4.6 Tested up to: 6.4 Requires PHP: 7.4 -Stable tag: 2.3.7 +Stable tag: 2.3.8 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -195,6 +195,9 @@ It is, in that it doesn't save any data that could be odds with GDPR compliance I use semantic versioning, with the first release being 1.0. += 2.3.8 = +* Bug: You know that vulnerability I fixed in 2.3.7? It fixed that but broke something else. That should now resolved. Apologies for that. + = 2.3.7 = * Bug: Fixed a bug which created a potentual vulnerabilty * Enhancement: Improved code quality, using the latest version of PHPCS and WordPress sniffs @@ -324,5 +327,5 @@ versions of this plugin == Upgrade Notice == -= 2.3.7 = -* Important vulnerability fix \ No newline at end of file += 2.3.8 = +* Critical bug fix \ No newline at end of file diff --git a/simple-code-embed.php b/simple-code-embed.php index 1b1ce62..4dcc891 100644 --- a/simple-code-embed.php +++ b/simple-code-embed.php @@ -9,7 +9,7 @@ * Plugin Name: Code Embed * Plugin URI: https://wordpress.org/plugins/simple-embed-code/ * Description: 🧩 Code Embed provides a very easy and efficient way to embed code (JavaScript and HTML) in your posts and pages. - * Version: 2.3.7 + * Version: 2.3.8 * Requires at least: 4.6 * Requires PHP: 7.4 * Author: David Artiss @@ -26,7 +26,7 @@ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -define( 'CODE_EMBED_VERSION', '2.3.7' ); +define( 'CODE_EMBED_VERSION', '2.3.8' ); // Include all the various functions.