Skip to content

Commit f01aa89

Browse files
authored
Merge pull request #29 from dartiss/develop
Version 2.3.2
2 parents d7e8ae7 + c2e5cc6 commit f01aa89

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

includes/add-embeds.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,23 +139,24 @@ function ce_filter( $content ) {
139139

140140
function ce_quick_replace( $content = '', $options = '', $search = '' ) {
141141

142-
$start_pos = strpos( $content, $options['opening_ident'] . $search, 0 );
143-
$prefix_len = strlen( $options['opening_ident'] );
142+
$start_pos = strpos( $content, $options['opening_ident'] . $search, 0 );
144143

145144
while ( false !== $start_pos ) {
146145

147-
$start_pos = $start_pos + strlen( $options['opening_ident'] );
148-
$end_pos = strpos( $content, $options['closing_ident'], $start_pos );
146+
$end_pos = strpos( $content, $options['closing_ident'], $start_pos + 1 );
149147

150148
if ( false !== $end_pos ) {
151-
$url = substr( $content, $start_pos, $end_pos - $start_pos );
149+
$url = substr( $content, $start_pos + 1, $end_pos - $start_pos - 1 );
152150
$file = ce_get_file( $url );
153151
if ( false !== $file ) {
154-
$content = str_replace( $options['opening_ident'] . $url . $options['closing_ident'], $file['file'], $content );
152+
$content = str_replace( $options['opening_ident'] . $url . $options['closing_ident'], $file, $content );
155153
} else {
156154
ce_report_error( __( 'File could not be fetched', 'simple-embed-code' ), 'Code Embed', false );
157155
}
158156
}
157+
158+
$start_pos = strpos( $content, $options['opening_ident'] . $search, 0 );
159+
159160
}
160161

161162
return $content;

readme.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Contributors: dartiss
33
Tags: code, embed, html, javascript, script
44
Requires at least: 4.6
5-
Tested up to: 4.9.4
5+
Tested up to: 4.9.6
66
Requires PHP: 5.3
7-
Stable tag: 2.3.1
7+
Stable tag: 2.3.2
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -187,6 +187,9 @@ It is, in that it doesn't save any data that could be odds with GDPR compliance
187187

188188
[Learn more about my version numbering methodology](https://artiss.blog/2016/09/wordpress-plugin-versioning/ "WordPress Plugin Versioning")
189189

190+
= 2.3.2 =
191+
* Bug: Fixed another pesky bug that was affecting embedded URLs. My code to do this was years old and I couldn't understand why I'd written it the way I had. So I've re-written it from scratch.
192+
190193
= 2.3.1 =
191194
* Bug: Fixed a variable naming issue that I may, or may not (I did), have created in the latest release
192195

@@ -293,5 +296,5 @@ versions of this plugin
293296

294297
== Upgrade Notice ==
295298

296-
= 2.3.1 =
299+
= 2.3.2 =
297300
* Minor bug fix

simple-code-embed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Code Embed
44
Plugin URI: https://github.com/dartiss/code-embed
55
Description: Code Embed provides a very easy and efficient way to embed code (JavaScript and HTML) in your posts and pages.
6-
Version: 2.3.1
6+
Version: 2.3.2
77
Author: David Artiss
88
Author URI: https://artiss.blog
99
Text Domain: simple-embed-code
@@ -18,7 +18,7 @@
1818
* @since 1.6
1919
*/
2020

21-
define( 'CODE_EMBED_VERSION', '2.3.1' );
21+
define( 'CODE_EMBED_VERSION', '2.3.2' );
2222

2323
// Include all the various functions
2424

0 commit comments

Comments
 (0)