mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-05 09:19:53 +08:00
* Fixed: connection problems caused by issues with json_encode function
This commit is contained in:
parent
197652ebcc
commit
329bd94989
4 changed files with 43 additions and 19 deletions
|
@ -115,7 +115,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainWP_Child {
|
class MainWP_Child {
|
||||||
public static $version = '4.0.6.1';
|
public static $version = '4.0.6.2';
|
||||||
private $update_version = '1.5';
|
private $update_version = '1.5';
|
||||||
|
|
||||||
private $callableFunctions = array(
|
private $callableFunctions = array(
|
||||||
|
|
|
@ -4,7 +4,7 @@ class MainWP_Helper {
|
||||||
|
|
||||||
static function write( $val ) {
|
static function write( $val ) {
|
||||||
if (isset( $_REQUEST['json_result'] ) && $_REQUEST['json_result'] == true) :
|
if (isset( $_REQUEST['json_result'] ) && $_REQUEST['json_result'] == true) :
|
||||||
$output = json_encode( $val );
|
$output = self::safe_json_encode( $val );
|
||||||
else:
|
else:
|
||||||
$output = serialize( $val );
|
$output = serialize( $val );
|
||||||
endif;
|
endif;
|
||||||
|
@ -12,10 +12,31 @@ class MainWP_Helper {
|
||||||
die( '<mainwp>' . base64_encode( $output ) . '</mainwp>' );
|
die( '<mainwp>' . base64_encode( $output ) . '</mainwp>' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function utf8ize($mixed) {
|
||||||
|
if (is_array($mixed)) {
|
||||||
|
foreach ($mixed as $key => $value) {
|
||||||
|
$mixed[$key] = self::utf8ize($value);
|
||||||
|
}
|
||||||
|
} elseif (is_string($mixed)) {
|
||||||
|
if ( function_exists( 'mb_convert_encoding' )) {
|
||||||
|
return mb_convert_encoding($mixed, "UTF-8", "UTF-8");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $mixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function safe_json_encode($value, $options = 0, $depth = 512) {
|
||||||
|
$encoded = @json_encode($value, $options, $depth);
|
||||||
|
if ($encoded === false && $value && json_last_error() == JSON_ERROR_UTF8) {
|
||||||
|
$encoded = @json_encode(self::utf8ize($value), $options, $depth);
|
||||||
|
}
|
||||||
|
return $encoded;
|
||||||
|
}
|
||||||
|
|
||||||
static function close_connection( $val = null ) {
|
static function close_connection( $val = null ) {
|
||||||
|
|
||||||
if (isset( $_REQUEST['json_result'] ) && $_REQUEST['json_result'] == true) :
|
if (isset( $_REQUEST['json_result'] ) && $_REQUEST['json_result'] == true) :
|
||||||
$output = json_encode( $val );
|
$output = self::safe_json_encode( $val );
|
||||||
else:
|
else:
|
||||||
$output = serialize( $val );
|
$output = serialize( $val );
|
||||||
endif;
|
endif;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
Author: MainWP
|
Author: MainWP
|
||||||
Author URI: https://mainwp.com
|
Author URI: https://mainwp.com
|
||||||
Text Domain: mainwp-child
|
Text Domain: mainwp-child
|
||||||
Version: 4.0.6.1
|
Version: 4.0.6.2
|
||||||
*/
|
*/
|
||||||
include_once( ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php' ); //Version information from wordpress
|
include_once( ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php' ); //Version information from wordpress
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ Plugin URI: https://mainwp.com
|
||||||
Requires at least: 3.6
|
Requires at least: 3.6
|
||||||
Tested up to: 5.3.2
|
Tested up to: 5.3.2
|
||||||
Requires PHP: 5.6
|
Requires PHP: 5.6
|
||||||
Stable tag: 4.0.6.1
|
Stable tag: 4.0.6.2
|
||||||
License: GPLv2 or later
|
License: GPLv2 or later
|
||||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
|
||||||
|
@ -71,6 +71,9 @@ To see full documentation and FAQs please visit [MainWP Documentation](https://m
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
|
= 4.0.6.2 - 2-3-20 =
|
||||||
|
* Fixed: connection problems caused by issues with json_encode function
|
||||||
|
|
||||||
= 4.0.6.1 - 1-20-20 =
|
= 4.0.6.1 - 1-20-20 =
|
||||||
* Updated: MainWP_Child_WPvivid_BackupRestore class
|
* Updated: MainWP_Child_WPvivid_BackupRestore class
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue