diff --git a/.github/workflows/daily-snapshots.yml b/.github/workflows/daily-snapshots.yml index 988a62bf9b..23e9c5fb6e 100644 --- a/.github/workflows/daily-snapshots.yml +++ b/.github/workflows/daily-snapshots.yml @@ -25,7 +25,7 @@ jobs: - { version: '6.0', branch: 'master', php-version: '8.2', node-version: '20', python-version: '3.11' } steps: - name: Check out code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: ${{ matrix.branch }} @@ -40,13 +40,13 @@ jobs: coverage: none - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: 'yarn' - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -78,7 +78,7 @@ jobs: continue-on-error: true - name: Upload snapshots - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: phpMyAdmin-${{ matrix.version }}-snapshots path: release/* diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index 0aa555d2d4..3fece2af24 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -23,10 +23,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '20' cache: 'yarn' @@ -42,10 +42,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '20' cache: 'yarn' @@ -61,10 +61,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '20' cache: 'yarn' diff --git a/.github/workflows/lint-and-analyse-php.yml b/.github/workflows/lint-and-analyse-php.yml index 509d1d0a8d..c0f8b54088 100644 --- a/.github/workflows/lint-and-analyse-php.yml +++ b/.github/workflows/lint-and-analyse-php.yml @@ -19,7 +19,7 @@ jobs: php-version: ["8.2"] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 @@ -40,7 +40,7 @@ jobs: - name: Cache coding-standard # Allow the previous check to fail but not abort if: always() - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: .phpcs-cache key: phpcs-cache @@ -67,7 +67,7 @@ jobs: php-version: ["8.2"] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml index 78b7d6a2b8..90f12398cb 100644 --- a/.github/workflows/lint-docs.yml +++ b/.github/workflows/lint-docs.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Lint phpdoc blocks uses: sudo-bot/action-doctum@v5 diff --git a/.github/workflows/mutation-tests.yml b/.github/workflows/mutation-tests.yml index 8233129f20..99ec580dea 100644 --- a/.github/workflows/mutation-tests.yml +++ b/.github/workflows/mutation-tests.yml @@ -34,13 +34,13 @@ jobs: - ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 2 - name: Checkout base ref code if: github.event_name == 'pull_request' - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: ${{ github.base_ref }} diff --git a/.github/workflows/other-tools.yml b/.github/workflows/other-tools.yml index 9adffe6729..9869806b9b 100644 --- a/.github/workflows/other-tools.yml +++ b/.github/workflows/other-tools.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install Sphinx for the documentation build run: | @@ -33,7 +33,7 @@ jobs: php-version: ["8.2"] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install gettext run: sudo apt-get install -y gettext @@ -49,13 +49,13 @@ jobs: uses: ramsey/composer-install@v3 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '20' cache: 'yarn' - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.11' diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index b701cdfda9..c8defe7b89 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Run ShellCheck uses: reviewdog/action-shellcheck@v1 diff --git a/.github/workflows/test-selenium.yml b/.github/workflows/test-selenium.yml index 2bb90281dd..6656232b09 100644 --- a/.github/workflows/test-selenium.yml +++ b/.github/workflows/test-selenium.yml @@ -82,7 +82,7 @@ jobs: - "Xss" steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install gettext run: sudo apt-get update && sudo apt-get install -y gettext @@ -101,7 +101,7 @@ jobs: uses: ramsey/composer-install@v3 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '20' cache: 'yarn' @@ -148,7 +148,7 @@ jobs: ./tests/stop-local-server - name: Upload screenshots - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: ${{ failure() }} with: name: selenium-screenshots diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 71207690a8..8ffa10812f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,7 @@ jobs: - { php-version: '82', experimental: false, arch: 's390x', exclude-phpunit-groups: '--exclude-group extension-iconv --exclude-group 32bit-incompatible' } steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Write script # tcpdf allowed memory exhausted needs the memory_limit workaround @@ -78,7 +78,7 @@ jobs: php-extensions: 'mbstring, iconv, mysqli, zip, bz2' steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: # Fetch some commits for Scrutinizer coverage upload fetch-depth: 15 @@ -139,7 +139,7 @@ jobs: extension: ["dbase"] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: # Fetch some commits for Scrutinizer coverage upload fetch-depth: 15 diff --git a/.github/workflows/update-po.yml b/.github/workflows/update-po.yml index 2bea112564..add1587be1 100644 --- a/.github/workflows/update-po.yml +++ b/.github/workflows/update-po.yml @@ -21,7 +21,7 @@ jobs: php-version: ["8.2"] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install Gettext run: | diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 266b5a8417..d3954461b3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -204,18 +204,6 @@ parameters: count: 1 path: examples/signon.php - - - message: '#^Comparison operation "\<" between int\<80200, 80599\> and 80200 is always false\.$#' - identifier: smaller.alwaysFalse - count: 1 - path: public/index.php - - - - message: '#^Comparison operation "\<" between int\<80200, 80599\> and 80200 is always false\.$#' - identifier: smaller.alwaysFalse - count: 1 - path: public/setup/index.php - - message: '#^Loose comparison via "\=\=" is not allowed\.$#' identifier: equal.notAllowed @@ -17928,12 +17916,24 @@ parameters: count: 1 path: tests/unit/UserPreferencesTest.php + - + message: '#^Cannot access offset ''secret'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: tests/unit/UserPreferencesTest.php + - message: '#^Cannot access offset ''server_2'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible count: 1 path: tests/unit/UserPreferencesTest.php + - + message: '#^Cannot access offset ''settings'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: tests/unit/UserPreferencesTest.php + - message: '#^Cannot access offset ''ts'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible @@ -17958,6 +17958,18 @@ parameters: count: 1 path: tests/unit/UserPreferencesTest.php + - + message: '#^Parameter \#2 \$result of method PhpMyAdmin\\Tests\\Stubs\\DbiDummy\:\:addResult\(\) expects bool\|list\\>, array\{array\{non\-empty\-string\|false, 1767029179\}\} given\.$#' + identifier: argument.type + count: 2 + path: tests/unit/UserPreferencesTest.php + + - + message: '#^Parameter \#3 \$subject of function str_replace expects array\\|string, string\|false given\.$#' + identifier: argument.type + count: 1 + path: tests/unit/UserPreferencesTest.php + - message: '#^Property PhpMyAdmin\\Config\:\:\$settings \(array\{PmaAbsoluteUri\: string, AuthLog\: string, AuthLogSuccess\: bool, PmaNoRelation_DisableWarning\: bool, SuhosinDisableWarning\: bool, LoginCookieValidityDisableWarning\: bool, ReservedWordDisableWarning\: bool, TranslationWarningThreshold\: int, \.\.\.\}\) does not accept array\{''Server/hide_db''\: ''testval123'', ''Server/port''\: ''213''\}\.$#' identifier: assign.propertyType diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 34262df8d2..5e80ca9331 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,7 @@ includes: - phpstan-baseline.neon parameters: + phpVersion: 80200 # PHP 8.2 level: max paths: - app diff --git a/public/themes/bootstrap/img/tree-collapse.svg b/public/themes/bootstrap/img/tree-collapse.svg index 8243f88c01..706ebf8799 100644 --- a/public/themes/bootstrap/img/tree-collapse.svg +++ b/public/themes/bootstrap/img/tree-collapse.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/public/themes/bootstrap/img/tree-expand.svg b/public/themes/bootstrap/img/tree-expand.svg index 769813f190..762aa0dad9 100644 --- a/public/themes/bootstrap/img/tree-expand.svg +++ b/public/themes/bootstrap/img/tree-expand.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/resources/js/modules/json-highlight.ts b/resources/js/modules/json-highlight.ts new file mode 100644 index 0000000000..726b4f0a4a --- /dev/null +++ b/resources/js/modules/json-highlight.ts @@ -0,0 +1,24 @@ + +/** + * Applies JSON syntax highlighting transformation using CodeMirror + * + * @param {JQuery} $base base element which contains the JSON code blocks + */ +export default function highlightJson ($base) { + var $elm = $base.find('code.json'); + $elm.each(function () { + var $json = $(this); + var $pre = $json.find('pre'); + /* We only care about visible elements to avoid double processing */ + if ($pre.is(':visible')) { + var $highlight = $('
'); + $json.append($highlight); + // @ts-ignore + if (typeof window.CodeMirror !== 'undefined' && typeof window.CodeMirror.runMode === 'function') { + // @ts-ignore + window.CodeMirror.runMode($json.text(), 'application/json', $highlight[0]); + $pre.hide(); + } + } + }); +} diff --git a/resources/js/sql.ts b/resources/js/sql.ts index 227a98f81d..7a38d1ce37 100644 --- a/resources/js/sql.ts +++ b/resources/js/sql.ts @@ -6,6 +6,7 @@ import { Navigation } from './modules/navigation.ts'; import { CommonParams } from './modules/common.ts'; import createProfilingChart from './modules/functions/createProfilingChart.ts'; import highlightSql from './modules/sql-highlight.ts'; +import highlightJson from './modules/json-highlight.ts'; import { ajaxRemoveMessage, ajaxShowMessage } from './modules/ajax-message.ts'; import { escapeBacktick, escapeHtml } from './modules/functions/escape.ts'; import refreshMainContent from './modules/functions/refreshMainContent.ts'; @@ -943,6 +944,7 @@ AJAX.registerOnload('sql.js', function () { .trigger('makeGrid'); highlightSql($sqlqueryresults); + highlightJson($sqlqueryresults); }); // end $.post() }); // end displayOptionsForm handler diff --git a/resources/js/transformations/json.ts b/resources/js/transformations/json.ts index e2df1dbf59..1bd12f0ba7 100644 --- a/resources/js/transformations/json.ts +++ b/resources/js/transformations/json.ts @@ -1,21 +1,10 @@ import $ from 'jquery'; import { AJAX } from '../modules/ajax.ts'; +import highlightJson from '../modules/json-highlight.ts'; /** * JSON syntax highlighting transformation plugin */ AJAX.registerOnload('transformations/json.js', function () { - var $elm = $('#page_content').find('code.json'); - $elm.each(function () { - var $json = $(this); - var $pre = $json.closest('pre'); - /* We only care about visible elements to avoid double processing */ - if ($json.is(':visible')) { - var $highlight = $('
'); - $pre.append($highlight); - // @ts-ignore - window.CodeMirror.runMode($json.text(), 'application/json', $highlight[0]); - $json.hide(); - } - }); + highlightJson($('#page_content')); }); diff --git a/resources/templates/database/structure/structure_table_row.twig b/resources/templates/database/structure/structure_table_row.twig index d69654e671..ee223ee3bd 100644 --- a/resources/templates/database/structure/structure_table_row.twig +++ b/resources/templates/database/structure/structure_table_row.twig @@ -234,7 +234,11 @@ - {{ t('in use') }} + {% if current_table['Comment'] is not empty %} + {{ current_table['Comment'] }} + {% else %} + {{ t('in use') }} + {% endif %} {% endif %} diff --git a/resources/templates/menu/main.twig b/resources/templates/menu/main.twig index 28e835a9c9..58dafa553f 100644 --- a/resources/templates/menu/main.twig +++ b/resources/templates/menu/main.twig @@ -21,7 +21,7 @@ {% if table is not empty %}