Version Description
Download this release
Release Info
Developer | cory@lamle.org |
Plugin | Duplicator – WordPress Migration Plugin |
Version | 1.3.28 |
Comparing to | |
See all releases |
Code changes from version 1.3.26 to 1.3.28
- ctrls/class.web.services.php +51 -13
- define.php +2 -2
- duplicator.php +1 -41
- installer/dup-installer/classes/class.engine.php +61 -51
- readme.txt +1 -1
- views/packages/details/detail.php +27 -22
ctrls/class.web.services.php
CHANGED
@@ -43,8 +43,8 @@ class DUP_Web_Services
|
|
43 |
/** Execute function * */
|
44 |
$error = false;
|
45 |
$result = array(
|
46 |
-
'data'
|
47 |
-
'html'
|
48 |
'message' => ''
|
49 |
);
|
50 |
|
@@ -54,8 +54,8 @@ class DUP_Web_Services
|
|
54 |
throw new Exception('Security issue');
|
55 |
}
|
56 |
|
57 |
-
DUP_Package::by_status_callback(array(__CLASS__,'package_delete_callback'),array(
|
58 |
-
|
59 |
));
|
60 |
|
61 |
/** reset active package id * */
|
@@ -66,7 +66,8 @@ class DUP_Web_Services
|
|
66 |
DUP_Package::not_active_files_tmp_cleanup();
|
67 |
|
68 |
//throw new Exception('force error test');
|
69 |
-
}
|
|
|
70 |
$error = true;
|
71 |
$result['message'] = $e->getMessage();
|
72 |
}
|
@@ -82,11 +83,45 @@ class DUP_Web_Services
|
|
82 |
}
|
83 |
}
|
84 |
|
85 |
-
public static function duplicator_download()
|
86 |
-
|
87 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
// Process download
|
89 |
-
if(file_exists($filepath)) {
|
90 |
// Clean output buffer
|
91 |
if (ob_get_level() !== 0 && @ob_end_clean() === FALSE) {
|
92 |
@ob_clean();
|
@@ -94,11 +129,11 @@ class DUP_Web_Services
|
|
94 |
|
95 |
header('Content-Description: File Transfer');
|
96 |
header('Content-Type: application/octet-stream');
|
97 |
-
header('Content-Disposition: attachment; filename="'.
|
98 |
header('Expires: 0');
|
99 |
header('Cache-Control: must-revalidate');
|
100 |
header('Pragma: public');
|
101 |
-
header('Content-Length: '
|
102 |
flush(); // Flush system output buffer
|
103 |
|
104 |
try {
|
@@ -110,12 +145,15 @@ class DUP_Web_Services
|
|
110 |
echo $data;
|
111 |
}
|
112 |
@fclose($fp);
|
113 |
-
}
|
|
|
114 |
readfile($filepath);
|
115 |
}
|
116 |
exit;
|
117 |
} else {
|
118 |
-
|
|
|
|
|
119 |
}
|
120 |
}
|
121 |
}
|
43 |
/** Execute function * */
|
44 |
$error = false;
|
45 |
$result = array(
|
46 |
+
'data' => array(),
|
47 |
+
'html' => '',
|
48 |
'message' => ''
|
49 |
);
|
50 |
|
54 |
throw new Exception('Security issue');
|
55 |
}
|
56 |
|
57 |
+
DUP_Package::by_status_callback(array(__CLASS__, 'package_delete_callback'), array(
|
58 |
+
array('op' => '<', 'status' => DUP_PackageStatus::COMPLETE)
|
59 |
));
|
60 |
|
61 |
/** reset active package id * */
|
66 |
DUP_Package::not_active_files_tmp_cleanup();
|
67 |
|
68 |
//throw new Exception('force error test');
|
69 |
+
}
|
70 |
+
catch (Exception $e) {
|
71 |
$error = true;
|
72 |
$result['message'] = $e->getMessage();
|
73 |
}
|
83 |
}
|
84 |
}
|
85 |
|
86 |
+
public static function duplicator_download()
|
87 |
+
{
|
88 |
+
$error = false;
|
89 |
+
|
90 |
+
if (!isset($_GET['id']) || !isset($_GET['hash']) || !isset($_GET['file'])) {
|
91 |
+
$error = true;
|
92 |
+
}
|
93 |
+
|
94 |
+
$packageId = (int) $_GET['id'];
|
95 |
+
$hash = sanitize_text_field($_GET['hash']);
|
96 |
+
$file = sanitize_text_field($_GET['file']);
|
97 |
+
|
98 |
+
if ($error || ($package = DUP_Package::getByID($packageId)) == false) {
|
99 |
+
$error = true;
|
100 |
+
}
|
101 |
+
|
102 |
+
if ($error || $hash !== $package->Hash) {
|
103 |
+
$error = true;
|
104 |
+
}
|
105 |
+
|
106 |
+
switch ($file) {
|
107 |
+
case 'sql':
|
108 |
+
$fileName = "{$package->NameHash}_database.sql";
|
109 |
+
break;
|
110 |
+
case 'archive':
|
111 |
+
$format = strtolower($package->Archive->Format);
|
112 |
+
$fileName = "{$package->NameHash}_archive.{$format}";
|
113 |
+
break;
|
114 |
+
case 'installer':
|
115 |
+
$fileName = $package->NameHash.'_installer.php';
|
116 |
+
break;
|
117 |
+
default:
|
118 |
+
$error = true;
|
119 |
+
}
|
120 |
+
|
121 |
+
$filepath = DUPLICATOR_SSDIR_PATH.'/'.$fileName;
|
122 |
+
|
123 |
// Process download
|
124 |
+
if (!$error && file_exists($filepath)) {
|
125 |
// Clean output buffer
|
126 |
if (ob_get_level() !== 0 && @ob_end_clean() === FALSE) {
|
127 |
@ob_clean();
|
129 |
|
130 |
header('Content-Description: File Transfer');
|
131 |
header('Content-Type: application/octet-stream');
|
132 |
+
header('Content-Disposition: attachment; filename="'.$fileName.'"');
|
133 |
header('Expires: 0');
|
134 |
header('Cache-Control: must-revalidate');
|
135 |
header('Pragma: public');
|
136 |
+
header('Content-Length: '.filesize($filepath));
|
137 |
flush(); // Flush system output buffer
|
138 |
|
139 |
try {
|
145 |
echo $data;
|
146 |
}
|
147 |
@fclose($fp);
|
148 |
+
}
|
149 |
+
catch (Exception $e) {
|
150 |
readfile($filepath);
|
151 |
}
|
152 |
exit;
|
153 |
} else {
|
154 |
+
// if the request is wrong wait to avoid brute force attack
|
155 |
+
sleep(2);
|
156 |
+
wp_die('Invalid request');
|
157 |
}
|
158 |
}
|
159 |
}
|
define.php
CHANGED
@@ -4,8 +4,8 @@ defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
|
4 |
//Prevent directly browsing to the file
|
5 |
if (function_exists('plugin_dir_url'))
|
6 |
{
|
7 |
-
define('DUPLICATOR_VERSION', '1.3.
|
8 |
-
define('DUPLICATOR_VERSION_BUILD', '2020-02-
|
9 |
define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
|
10 |
define('DUPLICATOR_SITE_URL', get_site_url());
|
11 |
|
4 |
//Prevent directly browsing to the file
|
5 |
if (function_exists('plugin_dir_url'))
|
6 |
{
|
7 |
+
define('DUPLICATOR_VERSION', '1.3.28');
|
8 |
+
define('DUPLICATOR_VERSION_BUILD', '2020-02-12_11:00');
|
9 |
define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
|
10 |
define('DUPLICATOR_SITE_URL', get_site_url());
|
11 |
|
duplicator.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Duplicator
|
4 |
Plugin URI: https://snapcreek.com/duplicator/duplicator-free/
|
5 |
Description: Migrate and backup a copy of your WordPress files and database. Duplicate and move a site from one location to another quickly.
|
6 |
-
Version: 1.3.
|
7 |
Author: Snap Creek
|
8 |
Author URI: http://www.snapcreek.com/duplicator/
|
9 |
Text Domain: duplicator
|
@@ -151,46 +151,6 @@ if (!function_exists('wp_normalize_path')) {
|
|
151 |
}
|
152 |
}
|
153 |
|
154 |
-
function duplicator_init() {
|
155 |
-
if (isset($_GET['action']) && $_GET['action'] == 'duplicator_download') {
|
156 |
-
$file = sanitize_text_field($_GET['file']);
|
157 |
-
$filepath = DUPLICATOR_SSDIR_PATH.'/'.$file;
|
158 |
-
// Process download
|
159 |
-
if(file_exists($filepath)) {
|
160 |
-
// Clean output buffer
|
161 |
-
if (ob_get_level() !== 0 && @ob_end_clean() === FALSE) {
|
162 |
-
@ob_clean();
|
163 |
-
}
|
164 |
-
|
165 |
-
header('Content-Description: File Transfer');
|
166 |
-
header('Content-Type: application/octet-stream');
|
167 |
-
header('Content-Disposition: attachment; filename="'.basename($filepath).'"');
|
168 |
-
header('Expires: 0');
|
169 |
-
header('Cache-Control: must-revalidate');
|
170 |
-
header('Pragma: public');
|
171 |
-
header('Content-Length: ' . filesize($filepath));
|
172 |
-
flush(); // Flush system output buffer
|
173 |
-
|
174 |
-
try {
|
175 |
-
$fp = @fopen($filepath, 'r');
|
176 |
-
if (false === $fp) {
|
177 |
-
throw new Exception('Fail to open the file '.$filepath);
|
178 |
-
}
|
179 |
-
while (!feof($fp) && ($data = fread($fp, DUPLICATOR_BUFFER_READ_WRITE_SIZE)) !== FALSE) {
|
180 |
-
echo $data;
|
181 |
-
}
|
182 |
-
@fclose($fp);
|
183 |
-
} catch (Exception $e) {
|
184 |
-
readfile($filepath);
|
185 |
-
}
|
186 |
-
exit;
|
187 |
-
} else {
|
188 |
-
wp_die('Invalid installer file name!!');
|
189 |
-
}
|
190 |
-
}
|
191 |
-
}
|
192 |
-
add_action('init', 'duplicator_init');
|
193 |
-
|
194 |
if (is_admin() == true)
|
195 |
{
|
196 |
if (defined('DUPLICATOR_DEACTIVATION_FEEDBACK') && DUPLICATOR_DEACTIVATION_FEEDBACK) {
|
3 |
Plugin Name: Duplicator
|
4 |
Plugin URI: https://snapcreek.com/duplicator/duplicator-free/
|
5 |
Description: Migrate and backup a copy of your WordPress files and database. Duplicate and move a site from one location to another quickly.
|
6 |
+
Version: 1.3.28
|
7 |
Author: Snap Creek
|
8 |
Author URI: http://www.snapcreek.com/duplicator/
|
9 |
Text Domain: duplicator
|
151 |
}
|
152 |
}
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
if (is_admin() == true)
|
155 |
{
|
156 |
if (defined('DUPLICATOR_DEACTIVATION_FEEDBACK') && DUPLICATOR_DEACTIVATION_FEEDBACK) {
|
installer/dup-installer/classes/class.engine.php
CHANGED
@@ -13,6 +13,11 @@ defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
|
13 |
|
14 |
class DUPX_UpdateEngine
|
15 |
{
|
|
|
|
|
|
|
|
|
|
|
16 |
private static $report = null;
|
17 |
|
18 |
/**
|
@@ -389,7 +394,7 @@ class DUPX_UpdateEngine
|
|
389 |
$upd_sql = array();
|
390 |
$where_sql = array();
|
391 |
$upd = false;
|
392 |
-
$serial_err =
|
393 |
$is_unkeyed = !in_array(true, $rowsParams['columns']);
|
394 |
|
395 |
$rowErrors = array();
|
@@ -403,15 +408,15 @@ class DUPX_UpdateEngine
|
|
403 |
}
|
404 |
|
405 |
$safe_column = '`'.mysqli_real_escape_string($dbh, $column).'`';
|
406 |
-
$edited_data = $
|
407 |
$base64converted = false;
|
408 |
$txt_found = false;
|
409 |
|
410 |
//Unkeyed table code
|
411 |
//Added this here to add all columns to $where_sql
|
412 |
//The if statement with $txt_found would skip additional columns -TG
|
413 |
-
if ($is_unkeyed && !empty($
|
414 |
-
$where_sql[] = $safe_column.' = "'.mysqli_real_escape_string($dbh, $
|
415 |
}
|
416 |
|
417 |
//Only replacing string values
|
@@ -458,7 +463,7 @@ class DUPX_UpdateEngine
|
|
458 |
|
459 |
// 0 no limit
|
460 |
if ($maxSerializeLenCheck > 0 && self::is_serialized_string($edited_data) && strlen($edited_data) > $maxSerializeLenCheck) {
|
461 |
-
$serial_err
|
462 |
$trimLen = DUPX_Log::isLevel(DUPX_Log::LV_HARD_DEBUG) ? 10000 : 200;
|
463 |
$rowErrors[$column] = 'ENGINE: serialize data too big to convert; data len:'.strlen($edited_data).' Max size:'.$maxSerializeLenCheck;
|
464 |
$rowErrors[$column] .= "\n\tDATA: ".mb_strimwidth($edited_data, 0, $trimLen, ' [...]');
|
@@ -480,33 +485,49 @@ class DUPX_UpdateEngine
|
|
480 |
$serial_check = self::fixSerialString($edited_data);
|
481 |
if ($serial_check['fixed']) {
|
482 |
$edited_data = $serial_check['data'];
|
483 |
-
}
|
484 |
-
$
|
485 |
-
$
|
486 |
-
|
487 |
-
|
|
|
|
|
488 |
}
|
489 |
}
|
490 |
}
|
491 |
}
|
492 |
}
|
|
|
|
|
|
|
|
|
|
|
493 |
|
494 |
//Change was made
|
495 |
-
if ($serial_err
|
496 |
$s3Funcs->report['updt_cells'] ++;
|
497 |
-
//Base 64 encode
|
498 |
-
if ($base64converted) {
|
499 |
-
$edited_data = base64_encode($edited_data);
|
500 |
-
}
|
501 |
$upd_col[] = $safe_column;
|
502 |
$upd_sql[] = $safe_column.' = "'.mysqli_real_escape_string($dbh, $edited_data).'"';
|
503 |
$upd = true;
|
504 |
}
|
505 |
|
506 |
if ($primary_key) {
|
507 |
-
$where_sql[] = $safe_column.' = "'.mysqli_real_escape_string($dbh, $
|
508 |
}
|
509 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
|
511 |
//PERFORM ROW UPDATE
|
512 |
if ($upd && !empty($where_sql)) {
|
@@ -514,18 +535,6 @@ class DUPX_UpdateEngine
|
|
514 |
$result = DUPX_DB::mysqli_query($dbh, $sql, __FILE__, __LINE__);
|
515 |
|
516 |
if ($result) {
|
517 |
-
foreach ($rowErrors as $errCol => $msgCol) {
|
518 |
-
$longMsg = $msgCol."\n\tTABLE:".$rowsParams['table'].' COLUMN: '.$errCol.' WHERE: '.implode(' AND ', array_filter($where_sql));
|
519 |
-
$s3Funcs->report['errser'][] = $longMsg;
|
520 |
-
|
521 |
-
$nManager->addFinalReportNotice(array(
|
522 |
-
'shortMsg' => 'DATA-REPLACE ERROR: Serialization',
|
523 |
-
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING,
|
524 |
-
'longMsg' => $longMsg,
|
525 |
-
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE,
|
526 |
-
'sections' => 'search_replace'
|
527 |
-
));
|
528 |
-
}
|
529 |
$s3Funcs->report['updt_rows'] ++;
|
530 |
$rowsParams['updated'] = true;
|
531 |
} else {
|
@@ -826,21 +835,25 @@ class DUPX_UpdateEngine
|
|
826 |
*/
|
827 |
public static function fixSerialString($data)
|
828 |
{
|
829 |
-
$result = array(
|
|
|
|
|
|
|
|
|
830 |
|
831 |
// check if serialized string must be fixed
|
832 |
-
if (
|
833 |
-
|
|
|
|
|
|
|
834 |
$serialized_fixed = self::recursiveFixSerialString($data);
|
835 |
-
|
836 |
if (self::unserializeTest($serialized_fixed)) {
|
837 |
-
|
838 |
-
$result['data'] = $serialized_fixed;
|
839 |
-
|
840 |
$result['fixed'] = true;
|
|
|
|
|
841 |
}
|
842 |
-
|
843 |
-
$result['tried'] = true;
|
844 |
}
|
845 |
|
846 |
return $result;
|
@@ -861,8 +874,7 @@ class DUPX_UpdateEngine
|
|
861 |
return $data;
|
862 |
}
|
863 |
|
864 |
-
$result
|
865 |
-
|
866 |
$matches = null;
|
867 |
|
868 |
$openLevel = 0;
|
@@ -877,21 +889,23 @@ class DUPX_UpdateEngine
|
|
877 |
$addChar = true;
|
878 |
|
879 |
if ($cChar == 's') {
|
880 |
-
|
881 |
// test if is a open string
|
882 |
-
if (preg_match(
|
|
|
|
|
|
|
|
|
883 |
|
884 |
$addChar = false;
|
885 |
|
886 |
-
$openLevel
|
887 |
|
888 |
$i += strlen($matches[0]) - 1;
|
889 |
}
|
890 |
} else if ($openLevel > 0 && $cChar == '"') {
|
891 |
|
892 |
// test if is a close string
|
893 |
-
if (preg_match(
|
894 |
-
|
895 |
$addChar = false;
|
896 |
|
897 |
switch ($openLevel) {
|
@@ -917,20 +931,16 @@ class DUPX_UpdateEngine
|
|
917 |
default:
|
918 |
// level > 2
|
919 |
// keep writing at level 2; it will be corrected with recursion
|
|
|
920 |
break;
|
921 |
}
|
922 |
|
923 |
-
$openLevel
|
924 |
-
|
925 |
-
$closeString = '";';
|
926 |
-
|
927 |
-
$i += strlen($closeString) - 1;
|
928 |
}
|
929 |
}
|
930 |
|
931 |
-
|
932 |
if ($addChar) {
|
933 |
-
|
934 |
switch ($openLevel) {
|
935 |
case 0:
|
936 |
// level 0
|
13 |
|
14 |
class DUPX_UpdateEngine
|
15 |
{
|
16 |
+
const SERIALIZE_OPEN_STR_REGEX = '/^(s:\d+:")/';
|
17 |
+
const SERIALIZE_CLOSE_STR_REGEX = '/^";}*(?:"|a:|s:|S:|b:|d:|i:|o:|O:|C:|r:|R:|N;|$)/';
|
18 |
+
const SERIALIZE_CLOSE_STR = '";';
|
19 |
+
const SERIALIZE_CLOSE_STR_LEN = 2;
|
20 |
+
|
21 |
private static $report = null;
|
22 |
|
23 |
/**
|
394 |
$upd_sql = array();
|
395 |
$where_sql = array();
|
396 |
$upd = false;
|
397 |
+
$serial_err = false;
|
398 |
$is_unkeyed = !in_array(true, $rowsParams['columns']);
|
399 |
|
400 |
$rowErrors = array();
|
408 |
}
|
409 |
|
410 |
$safe_column = '`'.mysqli_real_escape_string($dbh, $column).'`';
|
411 |
+
$edited_data = $originalData = $row[$column];
|
412 |
$base64converted = false;
|
413 |
$txt_found = false;
|
414 |
|
415 |
//Unkeyed table code
|
416 |
//Added this here to add all columns to $where_sql
|
417 |
//The if statement with $txt_found would skip additional columns -TG
|
418 |
+
if ($is_unkeyed && !empty($originalData)) {
|
419 |
+
$where_sql[] = $safe_column.' = "'.mysqli_real_escape_string($dbh, $originalData).'"';
|
420 |
}
|
421 |
|
422 |
//Only replacing string values
|
463 |
|
464 |
// 0 no limit
|
465 |
if ($maxSerializeLenCheck > 0 && self::is_serialized_string($edited_data) && strlen($edited_data) > $maxSerializeLenCheck) {
|
466 |
+
$serial_err = true;
|
467 |
$trimLen = DUPX_Log::isLevel(DUPX_Log::LV_HARD_DEBUG) ? 10000 : 200;
|
468 |
$rowErrors[$column] = 'ENGINE: serialize data too big to convert; data len:'.strlen($edited_data).' Max size:'.$maxSerializeLenCheck;
|
469 |
$rowErrors[$column] .= "\n\tDATA: ".mb_strimwidth($edited_data, 0, $trimLen, ' [...]');
|
485 |
$serial_check = self::fixSerialString($edited_data);
|
486 |
if ($serial_check['fixed']) {
|
487 |
$edited_data = $serial_check['data'];
|
488 |
+
} else {
|
489 |
+
$trimLen = DUPX_Log::isLevel(DUPX_Log::LV_HARD_DEBUG) ? 10000 : 200;
|
490 |
+
$message = 'ENGINE: serialize data serial check error'.
|
491 |
+
"\n\tDATA: ".mb_strimwidth($edited_data, 0, $trimLen, ' [...]');
|
492 |
+
DUPX_Log::info($message);
|
493 |
+
$serial_err = true;
|
494 |
+
$rowErrors[$column] = $message;
|
495 |
}
|
496 |
}
|
497 |
}
|
498 |
}
|
499 |
}
|
500 |
+
|
501 |
+
//Base 64 encode
|
502 |
+
if ($base64converted) {
|
503 |
+
$edited_data = base64_encode($edited_data);
|
504 |
+
}
|
505 |
|
506 |
//Change was made
|
507 |
+
if ($serial_err == false && $edited_data != $originalData) {
|
508 |
$s3Funcs->report['updt_cells'] ++;
|
|
|
|
|
|
|
|
|
509 |
$upd_col[] = $safe_column;
|
510 |
$upd_sql[] = $safe_column.' = "'.mysqli_real_escape_string($dbh, $edited_data).'"';
|
511 |
$upd = true;
|
512 |
}
|
513 |
|
514 |
if ($primary_key) {
|
515 |
+
$where_sql[] = $safe_column.' = "'.mysqli_real_escape_string($dbh, $originalData).'"';
|
516 |
}
|
517 |
}
|
518 |
+
|
519 |
+
foreach ($rowErrors as $errCol => $msgCol) {
|
520 |
+
$longMsg = $msgCol."\n\tTABLE:".$rowsParams['table'].' COLUMN: '.$errCol.' WHERE: '.implode(' AND ', array_filter($where_sql));
|
521 |
+
$s3Funcs->report['errser'][] = $longMsg;
|
522 |
+
|
523 |
+
$nManager->addFinalReportNotice(array(
|
524 |
+
'shortMsg' => 'DATA-REPLACE ERROR: Serialization',
|
525 |
+
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING,
|
526 |
+
'longMsg' => $longMsg,
|
527 |
+
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE,
|
528 |
+
'sections' => 'search_replace'
|
529 |
+
));
|
530 |
+
}
|
531 |
|
532 |
//PERFORM ROW UPDATE
|
533 |
if ($upd && !empty($where_sql)) {
|
535 |
$result = DUPX_DB::mysqli_query($dbh, $sql, __FILE__, __LINE__);
|
536 |
|
537 |
if ($result) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
$s3Funcs->report['updt_rows'] ++;
|
539 |
$rowsParams['updated'] = true;
|
540 |
} else {
|
835 |
*/
|
836 |
public static function fixSerialString($data)
|
837 |
{
|
838 |
+
$result = array(
|
839 |
+
'data' => null,
|
840 |
+
'fixed' => false,
|
841 |
+
'tried' => false
|
842 |
+
);
|
843 |
|
844 |
// check if serialized string must be fixed
|
845 |
+
if (self::unserializeTest($data)) {
|
846 |
+
$result['data'] = $data;
|
847 |
+
$result['fixed'] = true;
|
848 |
+
} else {
|
849 |
+
$result['tried'] = true;
|
850 |
$serialized_fixed = self::recursiveFixSerialString($data);
|
|
|
851 |
if (self::unserializeTest($serialized_fixed)) {
|
852 |
+
$result['data'] = $serialized_fixed;
|
|
|
|
|
853 |
$result['fixed'] = true;
|
854 |
+
} else {
|
855 |
+
$result['fixed'] = false;
|
856 |
}
|
|
|
|
|
857 |
}
|
858 |
|
859 |
return $result;
|
874 |
return $data;
|
875 |
}
|
876 |
|
877 |
+
$result = '';
|
|
|
878 |
$matches = null;
|
879 |
|
880 |
$openLevel = 0;
|
889 |
$addChar = true;
|
890 |
|
891 |
if ($cChar == 's') {
|
|
|
892 |
// test if is a open string
|
893 |
+
if (preg_match(self::SERIALIZE_OPEN_STR_REGEX, substr($data, $i, 20), $matches)) {
|
894 |
+
|
895 |
+
if ($openLevel > 1) {
|
896 |
+
$openContentL2 .= $matches[0];
|
897 |
+
}
|
898 |
|
899 |
$addChar = false;
|
900 |
|
901 |
+
$openLevel++;
|
902 |
|
903 |
$i += strlen($matches[0]) - 1;
|
904 |
}
|
905 |
} else if ($openLevel > 0 && $cChar == '"') {
|
906 |
|
907 |
// test if is a close string
|
908 |
+
if (preg_match(self::SERIALIZE_CLOSE_STR_REGEX, substr($data, $i, 7))) {
|
|
|
909 |
$addChar = false;
|
910 |
|
911 |
switch ($openLevel) {
|
931 |
default:
|
932 |
// level > 2
|
933 |
// keep writing at level 2; it will be corrected with recursion
|
934 |
+
$openContentL2 .= self::SERIALIZE_CLOSE_STR;
|
935 |
break;
|
936 |
}
|
937 |
|
938 |
+
$openLevel--;
|
939 |
+
$i += self::SERIALIZE_CLOSE_STR_LEN - 1;
|
|
|
|
|
|
|
940 |
}
|
941 |
}
|
942 |
|
|
|
943 |
if ($addChar) {
|
|
|
944 |
switch ($openLevel) {
|
945 |
case 0:
|
946 |
// level 0
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: migration, backup, duplicate, move, migrate, restore, transfer, clone, aut
|
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 5.3
|
6 |
Requires PHP: 5.2.17
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2
|
9 |
|
10 |
WordPress migration and backups are much easier with Duplicator! Clone, backup, move and transfer an entire site from one location to another.
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 5.3
|
6 |
Requires PHP: 5.2.17
|
7 |
+
Stable tag: 1.3.28
|
8 |
License: GPLv2
|
9 |
|
10 |
WordPress migration and backups are much easier with Duplicator! Clone, backup, move and transfer an entire site from one location to another.
|
views/packages/details/detail.php
CHANGED
@@ -7,29 +7,34 @@ $ui_css_archive = (isset($view_state['dup-package-dtl-archive-panel']) && $view_
|
|
7 |
$ui_css_install = (isset($view_state['dup-package-dtl-install-panel']) && $view_state['dup-package-dtl-install-panel']) ? 'display:block' : 'display:none';
|
8 |
|
9 |
$format = strtolower($package->Archive->Format);
|
10 |
-
|
11 |
$base_url = admin_url('admin-ajax.php');
|
12 |
-
$link_sql
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
$link_log = "{$package->StoreURL}{$package->NameHash}.log";
|
34 |
$link_scan = "{$package->StoreURL}{$package->NameHash}_scan.json";
|
35 |
|
7 |
$ui_css_install = (isset($view_state['dup-package-dtl-install-panel']) && $view_state['dup-package-dtl-install-panel']) ? 'display:block' : 'display:none';
|
8 |
|
9 |
$format = strtolower($package->Archive->Format);
|
|
|
10 |
$base_url = admin_url('admin-ajax.php');
|
11 |
+
$link_sql = add_query_arg(
|
12 |
+
array(
|
13 |
+
'action' => 'duplicator_download',
|
14 |
+
'id' => $package->ID,
|
15 |
+
'hash' => $package->Hash,
|
16 |
+
'file' => 'sql'
|
17 |
+
),
|
18 |
+
$base_url
|
19 |
+
);
|
20 |
+
$link_archive = add_query_arg(
|
21 |
+
array(
|
22 |
+
'action' => 'duplicator_download',
|
23 |
+
'id' => $package->ID,
|
24 |
+
'hash' => $package->Hash,
|
25 |
+
'file' => 'archive'
|
26 |
+
),
|
27 |
+
$base_url
|
28 |
+
);
|
29 |
+
$link_installer = add_query_arg(
|
30 |
+
array(
|
31 |
+
'action' => 'duplicator_download',
|
32 |
+
'id' => $package->ID,
|
33 |
+
'hash' => $package->Hash,
|
34 |
+
'file' => 'installer'
|
35 |
+
),
|
36 |
+
$base_url
|
37 |
+
);
|
38 |
$link_log = "{$package->StoreURL}{$package->NameHash}.log";
|
39 |
$link_scan = "{$package->StoreURL}{$package->NameHash}_scan.json";
|
40 |
|