Skip to content

Commit

Permalink
Fix changing JS paths
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyvolferts committed Apr 26, 2023
1 parent 3da1f06 commit d10744c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions class.tilda-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1182,11 +1182,11 @@ public static function export_tilda_page( $page_id, $project_id, $post_id ) {
}

$matches = [];
if ( preg_match_all( '/<script src="([a-z0-9-.]+\.min\.js)">/i', $tildapage->html, $matches ) ) {
if ( preg_match_all( '/<script src=[\'"]([a-z0-9-.]+\.min\.js)[\'"]/i', $tildapage->html, $matches ) ) {
$checked_matches = isset( $matches[0] ) ? $matches[0] : [];
foreach ( $checked_matches as $key => $match ) {
if ( ! empty( $matches[1][ $key ] ) ) {
$tildapage->html = str_replace( $match, '<script src="' . $upload_path . 'js/' . $matches[1][ $key ] . '">', $tildapage->html );
$tildapage->html = str_replace( $match, '<script src="' . $upload_path . 'js/' . $matches[1][ $key ] . '"', $tildapage->html );
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: tildapublishing
Donate link: https://wordpress.org/plugins/tilda-publishing/
Tags: blog, bulk, convert, crawl, data, import, importer, migrate, move, posts, publishing, tilda, export
Requires at least: 3.0.1
Tested up to: 6.1.1
Stable tag: 0.3.19
Tested up to: 6.2
Stable tag: 0.3.20
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -62,6 +62,9 @@ A: Please create an issue on the [GitHub page](https://github.com/TildaPublishin

== Changelog ==

= 0.3.20 =
* Fix changing JS paths

= 0.3.19 =
* Fix saving images locally

Expand Down
6 changes: 4 additions & 2 deletions tilda-wordpress-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
/*
Plugin Name: Tilda Publishing
Description: Tilda позволяет делать яркую подачу материала, качественную верстку и эффектную типографику, близкую к журнальной. Каким бы ни был ваш контент — Tilda знает, как его показать. С чего начать: 1) Нажмите ссылку «Активировать» слева от этого описания; 2) <a href="http://www.tilda.cc/" target="_blank">Зарегистрируйтесь</a>, чтобы получить API-ключ; 3) Перейдите на страницу настройки Tilda Publishing и введите свой API-ключ. Читайте подробную инструкцию по подключению.
Version: 0.3.19
Version: 0.3.20
Author: Tilda Publishing
License: GPLv2 or later
Text Domain: api tilda
Update 0.3.20 - fix changing JS paths
Update 0.3.19 - fix saving images locally
Update 0.3.18 - add backward compatibility
Expand Down Expand Up @@ -120,7 +122,7 @@
exit;
}

define( 'TILDA_VERSION', '0.3.19' );
define( 'TILDA_VERSION', '0.3.20' );
define( 'TILDA_MINIMUM_WP_VERSION', '3.1' );
define( 'TILDA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'TILDA_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Expand Down

0 comments on commit d10744c

Please sign in to comment.