Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions includes/add-embeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,24 @@ function ce_filter( $content ) {

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

$start_pos = strpos( $content, $options['opening_ident'] . $search, 0 );
$prefix_len = strlen( $options['opening_ident'] );
$start_pos = strpos( $content, $options['opening_ident'] . $search, 0 );

while ( false !== $start_pos ) {

$start_pos = $start_pos + strlen( $options['opening_ident'] );
$end_pos = strpos( $content, $options['closing_ident'], $start_pos );
$end_pos = strpos( $content, $options['closing_ident'], $start_pos + 1 );

if ( false !== $end_pos ) {
$url = substr( $content, $start_pos, $end_pos - $start_pos );
$url = substr( $content, $start_pos + 1, $end_pos - $start_pos - 1 );
$file = ce_get_file( $url );
if ( false !== $file ) {
$content = str_replace( $options['opening_ident'] . $url . $options['closing_ident'], $file['file'], $content );
$content = str_replace( $options['opening_ident'] . $url . $options['closing_ident'], $file, $content );
} else {
ce_report_error( __( 'File could not be fetched', 'simple-embed-code' ), 'Code Embed', false );
}
}

$start_pos = strpos( $content, $options['opening_ident'] . $search, 0 );

}

return $content;
Expand Down
9 changes: 6 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: dartiss
Tags: code, embed, html, javascript, script
Requires at least: 4.6
Tested up to: 4.9.4
Tested up to: 4.9.6
Requires PHP: 5.3
Stable tag: 2.3.1
Stable tag: 2.3.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

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

= 2.3.2 =
* 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.

= 2.3.1 =
* Bug: Fixed a variable naming issue that I may, or may not (I did), have created in the latest release

Expand Down Expand Up @@ -293,5 +296,5 @@ versions of this plugin

== Upgrade Notice ==

= 2.3.1 =
= 2.3.2 =
* Minor bug fix
4 changes: 2 additions & 2 deletions simple-code-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Code Embed
Plugin URI: https://github.com/dartiss/code-embed
Description: Code Embed provides a very easy and efficient way to embed code (JavaScript and HTML) in your posts and pages.
Version: 2.3.1
Version: 2.3.2
Author: David Artiss
Author URI: https://artiss.blog
Text Domain: simple-embed-code
Expand All @@ -18,7 +18,7 @@
* @since 1.6
*/

define( 'CODE_EMBED_VERSION', '2.3.1' );
define( 'CODE_EMBED_VERSION', '2.3.2' );

// Include all the various functions

Expand Down