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

@@ -18,7 +18,7 @@ class Template
public static function wrapper( $title="IPS Converter", $content="", $isError=false )
{
$iniTime = @ini_get('max_execution_time');
$execTime = ( is_numeric( $iniTime ) ) ? $iniTime : 30;
$execTime = ( \is_numeric( $iniTime ) ) ? $iniTime : 30;
$url = \IPSUtf8\Output\Browser::$url;
$title = ( empty( $title ) ) ? 'IPS Converter' : $title;
$active = array( 'convert' => '', 'tools' => '', 'archive' => '' );
@@ -191,7 +191,7 @@ EOFHTML;
<br>To override this and unlock the UTF8 converter, please create a file called "constants.php" and upload it to your /admin/convertutf8/ directory with the following contents:
</p>
<p><textarea class="form-control" style="height:90px;">&lt;?php
define( 'BYPASS_SAFETY_LOCK', true );
\\define( 'BYPASS_SAFETY_LOCK', true );
</textarea>
</p>
@@ -212,7 +212,7 @@ EOFHTML;
$canUseMb4 = ( version_compare( \IPSUtf8\Db::i()->server_info, '5.5.3', '>=' ) AND \IPSUtf8\Db::i('utf8')->set_charset('utf8mb4') !== FALSE );
\IPSUtf8\Db::i('utf8')->set_charset( $origUtf8Charset );
$badCollations = $convertClass::i()->getNonUtf8CollationTables();
$badTablesCnt = count( $convertClass::i()->getNonUtf8Tables() );
$badTablesCnt = \count( $convertClass::i()->getNonUtf8Tables() );
$path = ROOT_PATH;
$dbCharSetIsCorrect = TRUE;
$isUtf8mb4 = ( $isUtf8 === TRUE AND \IPSUtf8\Convert::i()->database_charset == 'utf8mb4' );
@@ -220,7 +220,7 @@ EOFHTML;
if ( file_exists( ROOT_PATH . '/conf_global.php' ) )
{
require_once( ROOT_PATH . '/conf_global.php' );
if ( !isset( $INFO['sql_charset'] ) OR ! in_array( $INFO['sql_charset'], array( 'utf8', 'utf8mb4' ) ) )
if ( !isset( $INFO['sql_charset'] ) OR ! \in_array( $INFO['sql_charset'], array( 'utf8', 'utf8mb4' ) ) )
{
$dbCharSetIsCorrect = FALSE;
}
@@ -257,9 +257,9 @@ EOFHTML;
}
else if ( $isUtf8 === true )
{
if ( count( $badCollations ) )
if ( \count( $badCollations ) )
{
$cnt = count( $badCollations );
$cnt = \count( $badCollations );
$html .= <<<EOFHTML
<p class="text-info">
The database is set to UTF-8, however {$cnt} table(s) have incorrect collations and need fixing.
@@ -282,33 +282,21 @@ EOFHTML;
}
if ( ! $isUtf8 and $canUseMb4 )
{
$buttonLabel = ( $isUtf8 ) ? "Convert anyway using 4-Byte UTF-8 (utf8mb4)" : "Start using 4-Byte UTF-8 (utf8mb4)";
{
$text = ( $status === 'processing' ) ? "Continue Conversion" : "Begin Conversion";
$html .= <<<EOFHTML
<p>
<a data-status="Start" class="btn btn-lg btn-info" href="{url="?controller={$controller}&amp;do=process&use_utf8mb4=1"}">{$buttonLabel}</a>
<br />
<div class='small'>
<small>
Some non-common symbols (such as historical scripts, music symbols and Emoji) require more space in the database to be stored. If you choose to convert using 4-Byte UTF-8, these characters will be able to be used, but the database will use more disk space.
</small>
</div>
<a data-status="{$status}" class="btn btn-lg btn-info" href="{url="?controller={$controller}&amp;do=process&use_utf8mb4=1"}">{$text}</a>
</p>
EOFHTML;
}
if ( ! $isUtf8 )
if ( ! $isUtf8 and !$canUseMb4 )
{
$label = 'Start using UTF-8 (utf8)';
$label = 'Start using UTF-8 (utf8)';
$selector = 'btn-success';
$more = <<<EOFHTML
<br />
<div class='small'>
<small>
Choose this if you don't wish to store non-common symbols (such as historical scripts, music symbols and Emoji) and wish to use less disk space.
</small>
</div>
<br>
<div class='small'>
<small>
@@ -336,11 +324,11 @@ if ( $status === 'processing' )
}
else if ( ! $isUtf8 )
{
$label = "Convert as UTF-8 (utf8)";
$label = "Begin Conversion";
$selector = 'btn-info';
}
if ( $label and $selector )
if ( $label and $selector AND ! $isUtf8 and ! $canUseMb4 )
{
$html .= <<<EOFHTML
<p>
+1 -1
View File
@@ -35,7 +35,7 @@ abstract class Output
{
if( static::$instance === NULL )
{
$classname = get_called_class();
$classname = \get_called_class();
static::$instance = new $classname;
}