You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-29 21:24:44 +03:00
@@ -2013,7 +2013,6 @@
|
||||
<code><![CDATA[$GLOBALS['result']]]></code>
|
||||
<code><![CDATA[$GLOBALS['run_query']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_file']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_query_disabled']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timeout_passed']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timestamp']]]></code>
|
||||
</InvalidArrayOffset>
|
||||
@@ -2047,7 +2046,6 @@
|
||||
<code><![CDATA[$GLOBALS['show_as_php']]]></code>
|
||||
<code><![CDATA[$GLOBALS['skip_queries']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_file']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_query_disabled']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timeout_passed']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timestamp']]]></code>
|
||||
<code>$bookmarkVariables</code>
|
||||
@@ -6685,8 +6683,6 @@
|
||||
<code><![CDATA[$GLOBALS['my_die']]]></code>
|
||||
<code><![CDATA[$GLOBALS['run_query']]]></code>
|
||||
<code><![CDATA[$GLOBALS['skip_queries']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_query_disabled']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_query_disabled']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timeout_passed']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timeout_passed']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timestamp']]]></code>
|
||||
@@ -6781,8 +6777,6 @@
|
||||
<code><![CDATA[$GLOBALS['run_query']]]></code>
|
||||
<code><![CDATA[$GLOBALS['skip_queries']]]></code>
|
||||
<code><![CDATA[$GLOBALS['skip_queries']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_query_disabled']]]></code>
|
||||
<code><![CDATA[$GLOBALS['sql_query_disabled']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timeout_passed']]]></code>
|
||||
<code><![CDATA[$GLOBALS['timestamp']]]></code>
|
||||
<code>$active</code>
|
||||
|
||||
@@ -81,7 +81,6 @@ final class ImportController extends AbstractController
|
||||
$GLOBALS['error'] ??= null;
|
||||
$GLOBALS['max_sql_len'] ??= null;
|
||||
$GLOBALS['msg'] ??= null;
|
||||
$GLOBALS['sql_query_disabled'] ??= null;
|
||||
$GLOBALS['executed_queries'] ??= null;
|
||||
$GLOBALS['run_query'] ??= null;
|
||||
$GLOBALS['reset_charset'] ??= null;
|
||||
@@ -287,7 +286,7 @@ final class ImportController extends AbstractController
|
||||
$GLOBALS['offset'] = 0;
|
||||
$GLOBALS['max_sql_len'] = 0;
|
||||
$GLOBALS['sql_query'] = '';
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
ImportSettings::$goSql = false;
|
||||
$GLOBALS['executed_queries'] = 0;
|
||||
$GLOBALS['run_query'] = true;
|
||||
@@ -494,7 +493,7 @@ final class ImportController extends AbstractController
|
||||
} elseif (ImportSettings::$charsetOfFile !== '' && ImportSettings::$charsetOfFile !== 'utf-8') {
|
||||
$this->dbi->query('SET NAMES \'' . ImportSettings::$charsetOfFile . '\'');
|
||||
// We can not show query in this case, it is in different charset
|
||||
$GLOBALS['sql_query_disabled'] = true;
|
||||
ImportSettings::$sqlQueryDisabled = true;
|
||||
$GLOBALS['reset_charset'] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,6 @@ class Import
|
||||
{
|
||||
$GLOBALS['error'] ??= null;
|
||||
$GLOBALS['msg'] ??= null;
|
||||
$GLOBALS['sql_query_disabled'] ??= null;
|
||||
$dbi = DatabaseInterface::getInstance();
|
||||
$GLOBALS['result'] = $dbi->tryQuery($sql);
|
||||
|
||||
@@ -167,7 +166,7 @@ class Import
|
||||
}
|
||||
}
|
||||
|
||||
if (! $GLOBALS['sql_query_disabled']) {
|
||||
if (! ImportSettings::$sqlQueryDisabled) {
|
||||
$GLOBALS['sql_query'] .= $GLOBALS['msg'] . "\n";
|
||||
}
|
||||
|
||||
@@ -204,7 +203,6 @@ class Import
|
||||
$GLOBALS['skip_queries'] ??= null;
|
||||
$GLOBALS['executed_queries'] ??= null;
|
||||
$GLOBALS['max_sql_len'] ??= null;
|
||||
$GLOBALS['sql_query_disabled'] ??= null;
|
||||
$GLOBALS['run_query'] ??= null;
|
||||
|
||||
ImportSettings::$readMultiply = 1;
|
||||
@@ -228,7 +226,7 @@ class Import
|
||||
$GLOBALS['max_sql_len'],
|
||||
mb_strlen($this->importRunBuffer),
|
||||
);
|
||||
if (! $GLOBALS['sql_query_disabled']) {
|
||||
if (! ImportSettings::$sqlQueryDisabled) {
|
||||
$GLOBALS['sql_query'] .= $this->importRunBuffer;
|
||||
}
|
||||
|
||||
@@ -237,7 +235,7 @@ class Import
|
||||
if ($GLOBALS['run_query'] && $GLOBALS['executed_queries'] < 50) {
|
||||
ImportSettings::$goSql = true;
|
||||
|
||||
if (! $GLOBALS['sql_query_disabled']) {
|
||||
if (! ImportSettings::$sqlQueryDisabled) {
|
||||
$GLOBALS['complete_query'] = $GLOBALS['sql_query'];
|
||||
$GLOBALS['display_query'] = $GLOBALS['sql_query'];
|
||||
} else {
|
||||
@@ -272,7 +270,7 @@ class Import
|
||||
|| $GLOBALS['max_sql_len'] > 1000
|
||||
) {
|
||||
$GLOBALS['sql_query'] = '';
|
||||
$GLOBALS['sql_query_disabled'] = true;
|
||||
ImportSettings::$sqlQueryDisabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,4 +11,5 @@ final class ImportSettings
|
||||
public static int $readMultiply = 0;
|
||||
public static int $readLimit = 0;
|
||||
public static bool $goSql = false;
|
||||
public static bool $sqlQueryDisabled = false;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ use PhpMyAdmin\Config;
|
||||
use PhpMyAdmin\Current;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Import\Import;
|
||||
use PhpMyAdmin\Import\ImportSettings;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
@@ -34,7 +35,7 @@ class ImportTest extends AbstractTestCase
|
||||
$GLOBALS['display_query'] = null;
|
||||
$GLOBALS['skip_queries'] = null;
|
||||
$GLOBALS['max_sql_len'] = null;
|
||||
$GLOBALS['sql_query_disabled'] = null;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
$GLOBALS['executed_queries'] = null;
|
||||
$this->import = new Import();
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ class ImportCsvTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
|
||||
$importHandle = new File($GLOBALS['import_file']);
|
||||
$importHandle->open();
|
||||
@@ -150,7 +150,7 @@ class ImportCsvTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
|
||||
$importHandle = new File($GLOBALS['import_file']);
|
||||
$importHandle->open();
|
||||
@@ -207,7 +207,7 @@ class ImportCsvTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
|
||||
$importHandle = new File($GLOBALS['import_file']);
|
||||
$importHandle->open();
|
||||
@@ -237,7 +237,7 @@ class ImportCsvTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
$GLOBALS['import_type'] = 'query';
|
||||
$GLOBALS['import_file'] = 'none';
|
||||
$GLOBALS['csv_terminated'] = ',';
|
||||
@@ -280,7 +280,7 @@ class ImportCsvTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
$GLOBALS['import_type'] = 'query';
|
||||
$GLOBALS['import_file'] = 'none';
|
||||
$GLOBALS['csv_terminated'] = ',';
|
||||
|
||||
@@ -125,7 +125,7 @@ class ImportLdiTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
$dbi = self::createMock(DatabaseInterface::class);
|
||||
$dbi->expects(self::any())->method('quoteString')
|
||||
->willReturnCallback(static fn (string $string): string => "'" . $string . "'");
|
||||
@@ -174,7 +174,7 @@ class ImportLdiTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
$dbi = self::createMock(DatabaseInterface::class);
|
||||
$dbi->expects(self::any())->method('quoteString')
|
||||
->willReturnCallback(static fn (string $string): string => "'" . $string . "'");
|
||||
|
||||
@@ -37,7 +37,7 @@ class ImportMediawikiTest extends AbstractTestCase
|
||||
Current::$database = '';
|
||||
$GLOBALS['skip_queries'] = null;
|
||||
$GLOBALS['max_sql_len'] = null;
|
||||
$GLOBALS['sql_query_disabled'] = null;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
$GLOBALS['sql_query'] = '';
|
||||
$GLOBALS['executed_queries'] = null;
|
||||
$GLOBALS['run_query'] = null;
|
||||
|
||||
@@ -111,7 +111,7 @@ class ImportOdsTest extends AbstractTestCase
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
//$import_notice will show the import detail result
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
|
||||
$GLOBALS['import_file'] = 'tests/test_data/db_test.ods';
|
||||
$_REQUEST['ods_empty_rows'] = true;
|
||||
@@ -168,7 +168,7 @@ class ImportOdsTest extends AbstractTestCase
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
//$import_notice will show the import detail result
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
|
||||
$GLOBALS['import_file'] = 'tests/test_data/import-slim.ods.xml';
|
||||
$_REQUEST['ods_col_names'] = true;
|
||||
|
||||
@@ -130,7 +130,7 @@ class ImportShpTest extends AbstractTestCase
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
//$import_notice will show the import detail result
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
Current::$database = '';
|
||||
|
||||
//Test function called
|
||||
@@ -165,7 +165,7 @@ class ImportShpTest extends AbstractTestCase
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
//$import_notice will show the import detail result
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
Current::$database = '';
|
||||
|
||||
//Test function called
|
||||
|
||||
@@ -72,7 +72,7 @@ class ImportSqlTest extends AbstractTestCase
|
||||
{
|
||||
//$sql_query_disabled will show the import SQL detail
|
||||
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
|
||||
//Mock DBI
|
||||
$dbi = $this->getMockBuilder(DatabaseInterface::class)
|
||||
|
||||
@@ -40,7 +40,7 @@ class ImportXmlTest extends AbstractTestCase
|
||||
Current::$database = '';
|
||||
$GLOBALS['skip_queries'] = null;
|
||||
$GLOBALS['max_sql_len'] = null;
|
||||
$GLOBALS['sql_query_disabled'] = null;
|
||||
ImportSettings::$sqlQueryDisabled = false;
|
||||
$GLOBALS['sql_query'] = '';
|
||||
$GLOBALS['executed_queries'] = null;
|
||||
$GLOBALS['run_query'] = null;
|
||||
|
||||
Reference in New Issue
Block a user