Changeset 3330309
- Timestamp:
- 07/18/2025 03:21:34 PM (9 months ago)
- Location:
- all-in-one-wp-migration/trunk
- Files:
-
- 8 edited
-
all-in-one-wp-migration.php (modified) (1 diff)
-
constants.php (modified) (1 diff)
-
lib/vendor/servmask/database/class-ai1wm-database-mysql.php (modified) (1 diff)
-
lib/vendor/servmask/database/class-ai1wm-database-mysqli.php (modified) (1 diff)
-
lib/vendor/servmask/database/class-ai1wm-database-sqlite.php (modified) (1 diff)
-
lib/vendor/servmask/database/class-ai1wm-database-utility.php (modified) (23 diffs)
-
lib/vendor/servmask/database/class-ai1wm-database.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
all-in-one-wp-migration/trunk/all-in-one-wp-migration.php
r3324445 r3330309 6 6 * Author: ServMask 7 7 * Author URI: https://servmask.com/ 8 * Version: 7.9 68 * Version: 7.97 9 9 * Text Domain: all-in-one-wp-migration 10 10 * Domain Path: /languages -
all-in-one-wp-migration/trunk/constants.php
r3324445 r3330309 38 38 // = Plugin Version = 39 39 // ================== 40 define( 'AI1WM_VERSION', '7.9 6' );40 define( 'AI1WM_VERSION', '7.97' ); 41 41 42 42 // =============== -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysql.php
r3266064 r3330309 31 31 32 32 class Ai1wm_Database_Mysql extends Ai1wm_Database { 33 34 /** 35 * Check whether table has auto increment attribute 36 * 37 * @param string $table_name Table name 38 * @return boolean 39 */ 40 public function has_auto_increment( $table_name ) { 41 return stripos( $this->get_create_table( $table_name ), 'AUTO_INCREMENT' ) !== false; 42 } 33 43 34 44 /** -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysqli.php
r3266064 r3330309 31 31 32 32 class Ai1wm_Database_Mysqli extends Ai1wm_Database { 33 34 /** 35 * Check whether table has auto increment attribute 36 * 37 * @param string $table_name Table name 38 * @return boolean 39 */ 40 public function has_auto_increment( $table_name ) { 41 return stripos( $this->get_create_table( $table_name ), 'AUTO_INCREMENT' ) !== false; 42 } 33 43 34 44 /** -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-sqlite.php
r3324445 r3330309 31 31 32 32 class Ai1wm_Database_Sqlite extends Ai1wm_Database { 33 34 /** 35 * Check whether table has auto increment attribute 36 * 37 * @param string $table_name Table name 38 * @return boolean 39 */ 40 public function has_auto_increment( $table_name ) { 41 return stripos( $this->get_create_table( $table_name ), 'AUTOINCREMENT' ) !== false; 42 } 33 43 34 44 /** -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-utility.php
r3253940 r3330309 120 120 switch ( $type ) { 121 121 case 's': 122 if ( $data[ $pos ] !== ':' ) { 122 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) { 123 $pos--; 123 124 return ''; 124 125 } … … 127 128 $len_end = strpos( $data, ':', $pos ); 128 129 if ( $len_end === false ) { 130 $pos--; 129 131 return ''; 130 132 } … … 133 135 134 136 $pos = $len_end + 1; 135 if ( $data[ $pos ] !== '"' ) { 137 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '"' ) { 138 $pos--; 136 139 return ''; 137 140 } … … 141 144 142 145 $pos += $str_length; 143 if ( $data[ $pos ] !== '"' ) { 144 return ''; 145 } 146 147 $pos++; 148 if ( $data[ $pos ] !== ';' ) { 146 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '"' ) { 147 $pos--; 148 return ''; 149 } 150 151 $pos++; 152 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ';' ) { 153 $pos--; 149 154 return ''; 150 155 } … … 173 178 case 'd': 174 179 case 'b': 175 if ( $data[ $pos ] !== ':' ) { 180 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) { 181 $pos--; 176 182 return ''; 177 183 } … … 180 186 $end = strpos( $data, ';', $pos ); 181 187 if ( $end === false ) { 188 $pos--; 182 189 return ''; 183 190 } … … 189 196 190 197 case 'N': 191 if ( $data[ $pos ] !== ';' ) { 198 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ';' ) { 199 $pos--; 192 200 return ''; 193 201 } … … 198 206 199 207 case 'a': 200 if ( $data[ $pos ] !== ':' ) { 208 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) { 209 $pos--; 201 210 return ''; 202 211 } … … 205 214 $len_end = strpos( $data, ':', $pos ); 206 215 if ( $len_end === false ) { 216 $pos--; 207 217 return ''; 208 218 } … … 211 221 212 222 $pos = $len_end + 1; 213 if ( $data[ $pos ] !== '{' ) { 223 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '{' ) { 224 $pos--; 214 225 return ''; 215 226 } … … 220 231 $element = self::parse_serialized_values( $data, $pos, $search, $replace ); 221 232 if ( $element === '' ) { 233 $pos--; 222 234 return ''; 223 235 } … … 226 238 } 227 239 228 if ( $data[ $pos ] !== '}' ) { 240 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '}' ) { 241 $pos--; 229 242 return ''; 230 243 } … … 236 249 237 250 case 'O': 238 if ( $data[ $pos ] !== ':' ) { 251 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) { 252 $pos--; 239 253 return ''; 240 254 } … … 243 257 $class_len_end = strpos( $data, ':', $pos ); 244 258 if ( $class_len_end === false ) { 259 $pos--; 245 260 return ''; 246 261 } … … 249 264 250 265 $pos = $class_len_end + 1; 251 if ( $data[ $pos ] !== '"' ) { 266 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '"' ) { 267 $pos--; 252 268 return ''; 253 269 } … … 257 273 258 274 $pos += $class_length; 259 if ( $data[ $pos ] !== '"' ) { 260 return ''; 261 } 262 263 $pos++; 264 if ( $data[ $pos ] !== ':' ) { 275 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '"' ) { 276 $pos--; 277 return ''; 278 } 279 280 $pos++; 281 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) { 282 $pos--; 265 283 return ''; 266 284 } … … 269 287 $prop_len_end = strpos( $data, ':', $pos ); 270 288 if ( $prop_len_end === false ) { 289 $pos--; 271 290 return ''; 272 291 } … … 275 294 276 295 $pos = $prop_len_end + 1; 277 if ( $data[ $pos ] !== '{' ) { 296 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '{' ) { 297 $pos--; 278 298 return ''; 279 299 } … … 284 304 $element = self::parse_serialized_values( $data, $pos, $search, $replace ); 285 305 if ( $element === '' ) { 306 $pos--; 286 307 return ''; 287 308 } … … 290 311 } 291 312 292 if ( $data[ $pos ] !== '}' ) { 313 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '}' ) { 314 $pos--; 293 315 return ''; 294 316 } … … 301 323 case 'R': 302 324 case 'r': 303 if ( $data[ $pos ] !== ':' ) { 325 if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) { 326 $pos--; 304 327 return ''; 305 328 } … … 308 331 $end = strpos( $data, ';', $pos ); 309 332 if ( $end === false ) { 333 $pos--; 310 334 return ''; 311 335 } … … 317 341 318 342 default: 343 $pos--; 319 344 return ''; 320 345 } -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database.php
r3324445 r3330309 362 362 public function get_old_replace_values() { 363 363 return $this->old_replace_values; 364 } 365 366 /** 367 * Get old replace values min length 368 * 369 * @return integer 370 */ 371 protected function get_old_replace_values_min_length() { 372 static $cached_result = null; 373 374 if ( $cached_result === null ) { 375 $cached_result = min( array_map( 'strlen', $this->get_old_replace_values() ) ); 376 } 377 378 return $cached_result; 364 379 } 365 380 … … 1461 1476 1462 1477 /** 1463 * Check whether table has auto increment attribute1464 *1465 * @param string $table_name Table name1466 * @return boolean1467 */1468 public function has_auto_increment( $table_name ) {1469 return stripos( $this->get_create_table( $table_name ), 'AUTO_INCREMENT' ) !== false;1470 }1471 1472 /**1473 1478 * Replace table quotes 1474 1479 * … … 1658 1663 1659 1664 // Replace values 1660 $matches[1] = Ai1wm_Database_Utility::replace_values( $matches[1], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1665 if ( strlen( $matches[1] ) >= $this->get_old_replace_values_min_length() ) { 1666 $matches[1] = Ai1wm_Database_Utility::replace_values( $matches[1], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1667 } 1661 1668 1662 1669 // Encode base64 characters … … 1681 1688 1682 1689 // Replace values 1683 $matches[2] = Ai1wm_Database_Utility::replace_values( $matches[2], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1690 if ( strlen( $matches[2] ) >= $this->get_old_replace_values_min_length() ) { 1691 $matches[2] = Ai1wm_Database_Utility::replace_values( $matches[2], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1692 } 1684 1693 1685 1694 // Encode base64 characters … … 1704 1713 1705 1714 // Replace serialized values 1706 $matches[1] = Ai1wm_Database_Utility::replace_serialized_values( $matches[1], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1715 if ( strlen( $matches[1] ) >= $this->get_old_replace_values_min_length() ) { 1716 $matches[1] = Ai1wm_Database_Utility::replace_serialized_values( $matches[1], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1717 } 1707 1718 1708 1719 // Encode base64 characters … … 1724 1735 1725 1736 // Replace serialized values 1726 $matches[1] = Ai1wm_Database_Utility::replace_serialized_values( $matches[1], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1737 if ( strlen( $matches[1] ) >= $this->get_old_replace_values_min_length() ) { 1738 $matches[1] = Ai1wm_Database_Utility::replace_serialized_values( $matches[1], $this->get_old_replace_values(), $this->get_new_replace_values() ); 1739 } 1727 1740 1728 1741 // Escape MySQL special characters … … 2122 2135 2123 2136 /** 2137 * Check whether table has auto increment attribute 2138 * 2139 * @param string $table_name Table name 2140 * @return boolean 2141 */ 2142 abstract public function has_auto_increment( $table_name ); 2143 2144 /** 2124 2145 * Run MySQL query 2125 2146 * -
all-in-one-wp-migration/trunk/readme.txt
r3324445 r3330309 5 5 Tested up to: 6.8 6 6 Requires PHP: 5.3 7 Stable tag: 7.9 67 Stable tag: 7.97 8 8 License: GPLv3 or later 9 9 … … 114 114 115 115 == Changelog == 116 = 7.97 = 117 **Added** 118 119 * SQLite support in AUTO_INCREMENT check 120 121 **Fixed** 122 123 * Database replacement for serialized values to handle edge cases with string length validation 124 116 125 = 7.96 = 117 126 **Added**
Note: See TracChangeset
for help on using the changeset viewer.