WP Multibyte Patch - Version 2.8.3

Version Description

Download this release

Release Info

Developer tenpura
Plugin Icon wp plugin WP Multibyte Patch
Version 2.8.3
Comparing to
See all releases

Code changes from version 2.8.2 to 2.8.3

Files changed (4) hide show
  1. ext/ja/class.php +6 -5
  2. readme.txt +3 -3
  3. wp-multibyte-patch.php +11 -10
  4. wplink.php +11 -1
ext/ja/class.php CHANGED
@@ -3,11 +3,11 @@
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
- * @version 2.8.2
7
  * @author Seisuke Kuraishi <210pura@gmail.com>
8
- * @copyright Copyright (c) 2018 Seisuke Kuraishi, Tinybit Inc.
9
- * @license http://opensource.org/licenses/gpl-2.0.php GPLv2
10
- * @link http://eastcoder.com/code/wp-multibyte-patch/
11
  */
12
 
13
  /**
@@ -179,12 +179,13 @@ if ( class_exists( 'multibyte_patch' ) ) :
179
  return $text;
180
 
181
  // If the caller is wp_dashboard_recent_drafts()
182
- if ( false !== $this->conf['patch_dashboard_recent_drafts'] && 10 === $num_words && is_admin() && strpos( wp_debug_backtrace_summary(), 'wp_dashboard_recent_drafts' ) )
183
  $num_words = $this->conf['dashboard_recent_drafts_mblength'];
184
 
185
  $text = $original_text;
186
  $text = wp_strip_all_tags( $text );
187
  $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
 
188
 
189
  if ( mb_strlen( $text, $this->blog_encoding ) > $num_words )
190
  $text = mb_substr( $text, 0, $num_words, $this->blog_encoding ) . $more;
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
+ * @version 2.8.3
7
  * @author Seisuke Kuraishi <210pura@gmail.com>
8
+ * @copyright Copyright (c) 2019 Seisuke Kuraishi, Tinybit Inc.
9
+ * @license https://opensource.org/licenses/gpl-2.0.php GPLv2
10
+ * @link https://eastcoder.com/code/wp-multibyte-patch/
11
  */
12
 
13
  /**
179
  return $text;
180
 
181
  // If the caller is wp_dashboard_recent_drafts()
182
+ if ( false !== $this->conf['patch_dashboard_recent_drafts'] && ( 40 === $num_words || 10 === $num_words ) && is_admin() && strpos( wp_debug_backtrace_summary(), 'wp_dashboard_recent_drafts' ) )
183
  $num_words = $this->conf['dashboard_recent_drafts_mblength'];
184
 
185
  $text = $original_text;
186
  $text = wp_strip_all_tags( $text );
187
  $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
188
+ $num_words = (int) $num_words;
189
 
190
  if ( mb_strlen( $text, $this->blog_encoding ) > $num_words )
191
  $text = mb_substr( $text, 0, $num_words, $this->blog_encoding ) . $more;
readme.txt CHANGED
@@ -2,15 +2,15 @@
2
  Contributors: tenpura
3
  Tags: multibyte,i18n,wp-multibyte-patch,Japanese
4
  Requires at least: 4.5
5
- Tested up to: 5.0
6
- Stable tag: 2.8.2
7
 
8
  Multibyte functionality enhancement for the WordPress Japanese package.
9
 
10
  == Description ==
11
 
12
  Multibyte functionality enhancement for the WordPress Japanese package.
13
- [日本語の説明を読む](http://eastcoder.com/code/wp-multibyte-patch/ "Documentation in Japanese")
14
 
15
  == Installation ==
16
 
2
  Contributors: tenpura
3
  Tags: multibyte,i18n,wp-multibyte-patch,Japanese
4
  Requires at least: 4.5
5
+ Tested up to: 5.3
6
+ Stable tag: 2.8.3
7
 
8
  Multibyte functionality enhancement for the WordPress Japanese package.
9
 
10
  == Description ==
11
 
12
  Multibyte functionality enhancement for the WordPress Japanese package.
13
+ [日本語の説明を読む](https://eastcoder.com/code/wp-multibyte-patch/ "Documentation in Japanese")
14
 
15
  == Installation ==
16
 
wp-multibyte-patch.php CHANGED
@@ -2,10 +2,10 @@
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
- Version: 2.8.2
6
- Plugin URI: http://eastcoder.com/code/wp-multibyte-patch/
7
  Author: Seisuke Kuraishi
8
- Author URI: http://tinybit.co.jp/
9
  License: GPLv2
10
  Text Domain: wp-multibyte-patch
11
  Domain Path: /languages
@@ -15,11 +15,11 @@ Domain Path: /languages
15
  * Multibyte functionality enhancement for the WordPress Japanese package.
16
  *
17
  * @package WP_Multibyte_Patch
18
- * @version 2.8.2
19
  * @author Seisuke Kuraishi <210pura@gmail.com>
20
- * @copyright Copyright (c) 2018 Seisuke Kuraishi, Tinybit Inc.
21
- * @license http://opensource.org/licenses/gpl-2.0.php GPLv2
22
- * @link http://eastcoder.com/code/wp-multibyte-patch/
23
  */
24
 
25
  /**
@@ -107,8 +107,9 @@ class multibyte_patch {
107
 
108
  $from_encoding = isset( $_POST['charset'] ) ? $_POST['charset'] : '';
109
 
110
- if ( !$from_encoding )
111
- $from_encoding = ( preg_match( "/^.*charset=([a-zA-Z0-9\-_]+).*$/i", $_SERVER['CONTENT_TYPE'], $matched ) ) ? $matched[1] : '';
 
112
 
113
  $from_encoding = str_replace( array( ',', ' ' ), '', strtoupper( trim( $from_encoding ) ) );
114
  $from_encoding = $this->guess_encoding( $excerpt . $title . $blog_name, $from_encoding );
@@ -166,7 +167,7 @@ class multibyte_patch {
166
  break;
167
  }
168
 
169
- if ( !$context )
170
  return $commentdata;
171
 
172
  $context[1] = strip_tags( $context[1] );
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
+ Version: 2.8.3
6
+ Plugin URI: https://eastcoder.com/code/wp-multibyte-patch/
7
  Author: Seisuke Kuraishi
8
+ Author URI: https://tinybit.co.jp/
9
  License: GPLv2
10
  Text Domain: wp-multibyte-patch
11
  Domain Path: /languages
15
  * Multibyte functionality enhancement for the WordPress Japanese package.
16
  *
17
  * @package WP_Multibyte_Patch
18
+ * @version 2.8.3
19
  * @author Seisuke Kuraishi <210pura@gmail.com>
20
+ * @copyright Copyright (c) 2019 Seisuke Kuraishi, Tinybit Inc.
21
+ * @license https://opensource.org/licenses/gpl-2.0.php GPLv2
22
+ * @link https://eastcoder.com/code/wp-multibyte-patch/
23
  */
24
 
25
  /**
107
 
108
  $from_encoding = isset( $_POST['charset'] ) ? $_POST['charset'] : '';
109
 
110
+ if ( empty( $from_encoding ) && preg_match( "/^.*charset=([a-zA-Z0-9\-_]+).*$/i", $_SERVER['CONTENT_TYPE'], $matched ) ) {
111
+ $from_encoding = isset( $matched[1] ) ? $matched[1] : '';
112
+ }
113
 
114
  $from_encoding = str_replace( array( ',', ' ' ), '', strtoupper( trim( $from_encoding ) ) );
115
  $from_encoding = $this->guess_encoding( $excerpt . $title . $blog_name, $from_encoding );
167
  break;
168
  }
169
 
170
+ if ( empty( $context ) )
171
  return $commentdata;
172
 
173
  $context[1] = strip_tags( $context[1] );
wplink.php CHANGED
@@ -45,6 +45,16 @@ if( ! $out )
45
  if( isset( $_GET['sd'] ) )
46
  echo str_replace( 'search.length > 2', 'search.length > 1', $out );
47
  else
48
- echo str_replace( '.length>2){if', '.length>1){if', $out );
 
 
 
 
 
 
 
 
 
 
49
 
50
  exit;
45
  if( isset( $_GET['sd'] ) )
46
  echo str_replace( 'search.length > 2', 'search.length > 1', $out );
47
  else
48
+ echo str_replace(
49
+ array(
50
+ '(2<t.length){if',
51
+ '.length>2){if',
52
+ ),
53
+ array(
54
+ '(1<t.length){if',
55
+ '.length>1){if',
56
+ ),
57
+ $out
58
+ );
59
 
60
  exit;