Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+11 -8
View File
@@ -361,7 +361,7 @@ class Session
$allTables = array();
$data = array( 'version' => \IPSUtf8\Convert::VERSION_ID, 'tableCount' => 0, 'totalCount' => 0, 'convertedCount' => 0, 'charSets' => array() );
if ( defined( 'FORCE_CONVERT' ) AND FORCE_CONVERT === TRUE )
if ( \defined( 'FORCE_CONVERT' ) AND FORCE_CONVERT === TRUE )
{
$data['force_conversion'] = 1;
}
@@ -406,7 +406,7 @@ class Session
foreach( $tables as $table )
{
/* Get count */
$row = \IPSUtf8\Db::i()->query( "SELECT COUNT(*) as count FROM `" . \IPSUtf8\Db::i()->prefix . "{$table}`" )->fetch_assoc();
$row = \IPSUtf8\Db::i()->query( "SELECT count(*) as count FROM `" . \IPSUtf8\Db::i()->prefix . "{$table}`" )->fetch_assoc();
$count = $row['count'];
$data['totalCount'] += $count;
@@ -485,6 +485,9 @@ class Session
'count' => $count,
'charset' => $tblCharset
);
/* Ping the UTF8 connection just in case this process takes a while, so that connection doesn't die on us */
\IPSUtf8\Db::i('utf8')->ping();
}
return array( 'tables' => $allTables, 'data' => $data );
@@ -513,7 +516,7 @@ class Session
if( isset( $this->_data[ $key ] ) )
{
if ( mb_substr( $key, -5 ) == '_json' AND ! is_array( $this->_data[ $key ] ) )
if ( mb_substr( $key, -5 ) == '_json' AND ! \is_array( $this->_data[ $key ] ) )
{
$this->_data[ $key ] = json_decode( $this->_data[ $key ], true );
}
@@ -606,19 +609,19 @@ class Session
/* JSON encode if required */
foreach ( array_merge( $this->_data, $this->changed ) as $k => $v )
{
$insert[ $k ] = ( mb_substr( $k, -5 ) == '_json' AND is_array( $v ) ) ? json_encode( $v, true ) : $v;
$insert[ $k ] = ( mb_substr( $k, -5 ) == '_json' AND \is_array( $v ) ) ? json_encode( $v, true ) : $v;
}
}
else
{
foreach ( $this->_data as $k => $v )
{
$insert[ $k ] = ( mb_substr( $k, -5 ) == '_json' AND is_array( $v ) ) ? json_encode( $v, true ) : $v;
$insert[ $k ] = ( mb_substr( $k, -5 ) == '_json' AND \is_array( $v ) ) ? json_encode( $v, true ) : $v;
}
}
/* Save */
if ( count( $insert ) == count( static::$sessionTableColumns ) )
if ( \count( $insert ) == \count( static::$sessionTableColumns ) )
{
\IPSUtf8\Db::i('utf8')->update( 'convert_session', $insert );
}
@@ -637,14 +640,14 @@ class Session
*/
public function arrayWalkRecursive( $array, $callback )
{
if ( ! is_array( $array ) )
if ( ! \is_array( $array ) )
{
trigger_error( "\$array is not an array in \IPSUtf8\Session::arrayWalkRecursive()", E_USER_ERROR );
}
foreach( $array AS $key => $value )
{
if ( is_array( $array[$key] ) )
if ( \is_array( $array[$key] ) )
{
$array[$key] = static::arrayWalkRecursive( $array[$key], $callback );
}