Plugin Directory

Changeset 3330309


Ignore:
Timestamp:
07/18/2025 03:21:34 PM (9 months ago)
Author:
bangelov
Message:

Adding v7.97

Location:
all-in-one-wp-migration/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • all-in-one-wp-migration/trunk/all-in-one-wp-migration.php

    r3324445 r3330309  
    66 * Author: ServMask
    77 * Author URI: https://servmask.com/
    8  * Version: 7.96
     8 * Version: 7.97
    99 * Text Domain: all-in-one-wp-migration
    1010 * Domain Path: /languages
  • all-in-one-wp-migration/trunk/constants.php

    r3324445 r3330309  
    3838// = Plugin Version =
    3939// ==================
    40 define( 'AI1WM_VERSION', '7.96' );
     40define( 'AI1WM_VERSION', '7.97' );
    4141
    4242// ===============
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysql.php

    r3266064 r3330309  
    3131
    3232class 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    }
    3343
    3444    /**
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysqli.php

    r3266064 r3330309  
    3131
    3232class 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    }
    3343
    3444    /**
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-sqlite.php

    r3324445 r3330309  
    3131
    3232class 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    }
    3343
    3444    /**
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-utility.php

    r3253940 r3330309  
    120120        switch ( $type ) {
    121121            case 's':
    122                 if ( $data[ $pos ] !== ':' ) {
     122                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) {
     123                    $pos--;
    123124                    return '';
    124125                }
     
    127128                $len_end = strpos( $data, ':', $pos );
    128129                if ( $len_end === false ) {
     130                    $pos--;
    129131                    return '';
    130132                }
     
    133135
    134136                $pos = $len_end + 1;
    135                 if ( $data[ $pos ] !== '"' ) {
     137                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '"' ) {
     138                    $pos--;
    136139                    return '';
    137140                }
     
    141144
    142145                $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--;
    149154                    return '';
    150155                }
     
    173178            case 'd':
    174179            case 'b':
    175                 if ( $data[ $pos ] !== ':' ) {
     180                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) {
     181                    $pos--;
    176182                    return '';
    177183                }
     
    180186                $end = strpos( $data, ';', $pos );
    181187                if ( $end === false ) {
     188                    $pos--;
    182189                    return '';
    183190                }
     
    189196
    190197            case 'N':
    191                 if ( $data[ $pos ] !== ';' ) {
     198                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ';' ) {
     199                    $pos--;
    192200                    return '';
    193201                }
     
    198206
    199207            case 'a':
    200                 if ( $data[ $pos ] !== ':' ) {
     208                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) {
     209                    $pos--;
    201210                    return '';
    202211                }
     
    205214                $len_end = strpos( $data, ':', $pos );
    206215                if ( $len_end === false ) {
     216                    $pos--;
    207217                    return '';
    208218                }
     
    211221
    212222                $pos = $len_end + 1;
    213                 if ( $data[ $pos ] !== '{' ) {
     223                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '{' ) {
     224                    $pos--;
    214225                    return '';
    215226                }
     
    220231                    $element = self::parse_serialized_values( $data, $pos, $search, $replace );
    221232                    if ( $element === '' ) {
     233                        $pos--;
    222234                        return '';
    223235                    }
     
    226238                }
    227239
    228                 if ( $data[ $pos ] !== '}' ) {
     240                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '}' ) {
     241                    $pos--;
    229242                    return '';
    230243                }
     
    236249
    237250            case 'O':
    238                 if ( $data[ $pos ] !== ':' ) {
     251                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) {
     252                    $pos--;
    239253                    return '';
    240254                }
     
    243257                $class_len_end = strpos( $data, ':', $pos );
    244258                if ( $class_len_end === false ) {
     259                    $pos--;
    245260                    return '';
    246261                }
     
    249264
    250265                $pos = $class_len_end + 1;
    251                 if ( $data[ $pos ] !== '"' ) {
     266                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '"' ) {
     267                    $pos--;
    252268                    return '';
    253269                }
     
    257273
    258274                $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--;
    265283                    return '';
    266284                }
     
    269287                $prop_len_end = strpos( $data, ':', $pos );
    270288                if ( $prop_len_end === false ) {
     289                    $pos--;
    271290                    return '';
    272291                }
     
    275294
    276295                $pos = $prop_len_end + 1;
    277                 if ( $data[ $pos ] !== '{' ) {
     296                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '{' ) {
     297                    $pos--;
    278298                    return '';
    279299                }
     
    284304                    $element = self::parse_serialized_values( $data, $pos, $search, $replace );
    285305                    if ( $element === '' ) {
     306                        $pos--;
    286307                        return '';
    287308                    }
     
    290311                }
    291312
    292                 if ( $data[ $pos ] !== '}' ) {
     313                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== '}' ) {
     314                    $pos--;
    293315                    return '';
    294316                }
     
    301323            case 'R':
    302324            case 'r':
    303                 if ( $data[ $pos ] !== ':' ) {
     325                if ( ! isset( $data[ $pos ] ) || $data[ $pos ] !== ':' ) {
     326                    $pos--;
    304327                    return '';
    305328                }
     
    308331                $end = strpos( $data, ';', $pos );
    309332                if ( $end === false ) {
     333                    $pos--;
    310334                    return '';
    311335                }
     
    317341
    318342            default:
     343                $pos--;
    319344                return '';
    320345        }
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database.php

    r3324445 r3330309  
    362362    public function get_old_replace_values() {
    363363        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;
    364379    }
    365380
     
    14611476
    14621477    /**
    1463      * Check whether table has auto increment attribute
    1464      *
    1465      * @param  string  $table_name Table name
    1466      * @return boolean
    1467      */
    1468     public function has_auto_increment( $table_name ) {
    1469         return stripos( $this->get_create_table( $table_name ), 'AUTO_INCREMENT' ) !== false;
    1470     }
    1471 
    1472     /**
    14731478     * Replace table quotes
    14741479     *
     
    16581663
    16591664            // 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            }
    16611668
    16621669            // Encode base64 characters
     
    16811688
    16821689            // 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            }
    16841693
    16851694            // Encode base64 characters
     
    17041713
    17051714            // 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            }
    17071718
    17081719            // Encode base64 characters
     
    17241735
    17251736        // 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        }
    17271740
    17281741        // Escape MySQL special characters
     
    21222135
    21232136    /**
     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    /**
    21242145     * Run MySQL query
    21252146     *
  • all-in-one-wp-migration/trunk/readme.txt

    r3324445 r3330309  
    55Tested up to: 6.8
    66Requires PHP: 5.3
    7 Stable tag: 7.96
     7Stable tag: 7.97
    88License: GPLv3 or later
    99
     
    114114
    115115== 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
    116125= 7.96 =
    117126**Added**
Note: See TracChangeset for help on using the changeset viewer.