Merge branch 'QA_5_2'

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2025-01-16 03:01:46 +01:00
commit f44bb362e4
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
19 changed files with 123 additions and 36 deletions

View File

@ -57,7 +57,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.11'
- name: Install Sphinx for the documentation build
run: pip install 'Sphinx'

View File

@ -329,6 +329,98 @@ You can configure several phpMyAdmin features using environment variables:
If set, this option will change the default Apache port from `80` in case you want it to run on a different port like an unprivileged port. Set to any port value (such as `APACHE_PORT=8090`).
.. envvar:: PMA_SSL_DIR
Define the path used for SSL files generated from environment variables, default value is `/etc/phpmyadmin/ssl`.
.. envvar:: PMA_SSL
When set to `1`, defines SSL usage for the MySQL connection.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl']`
.. envvar:: PMA_SSLS
Comma-separated list of `0` and `1` defining SSL usage for the corresponding MySQL connections.
.. envvar:: PMA_SSL_VERIFY
When set to `1`, enables SSL certificate verification for the MySQL connection.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_verify']`
.. envvar:: PMA_SSL_VERIFIES
Comma-separated list of `0` and `1` to enable or disable SSL certificate verification for multiple MySQL connections.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_verify']`
.. envvar:: PMA_SSL_CA
In the context of mutual TLS security, allows setting your CA file as a string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_ca']`
.. envvar:: PMA_SSL_CAS
In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_CA_BASE64
In the context of mutual TLS security, allows setting your CA file as a base64 string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_ca']`
.. envvar:: PMA_SSL_CAS_BASE64
In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of base64 strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_CERT
In the context of mutual TLS security, allows setting your CERT file as a string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_cert']`
.. envvar:: PMA_SSL_CERTS
In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_CERT_BASE64
In the context of mutual TLS security, allows setting your CERT file as a base64 string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_cert']`
.. envvar:: PMA_SSL_CERTS_BASE64
In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of base64 strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_KEY
In the context of mutual TLS security, allows setting your KEY file as a string inside the default `config.inc.php`.
.. envvar:: PMA_SSL_KEYS
In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of strings inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_key']`
.. envvar:: PMA_SSL_KEY_BASE64
In the context of mutual TLS security, allows setting your KEY file as a base64 string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_key']`
.. envvar:: PMA_SSL_KEYS_BASE64
In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of base64 strings inside the default `config.inc.php`.
.. envvar:: TZ
If defined, this option will change the default PHP `date.timezone` from `UTC`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['SessionTimeZone']`
By default, :ref:`cookie` is used, but if :envvar:`PMA_USER` and
:envvar:`PMA_PASSWORD` are set, it is switched to :ref:`auth_config`.

View File

@ -2382,12 +2382,6 @@ parameters:
count: 1
path: src/Controllers/Database/Structure/FavoriteTableController.php
-
message: '#^Cannot access offset non\-falsy\-string on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Controllers/Database/Structure/FavoriteTableController.php
-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed
@ -2400,12 +2394,6 @@ parameters:
count: 1
path: src/Controllers/Database/Structure/FavoriteTableController.php
-
message: '#^Parameter \#3 \$favoriteTables of method PhpMyAdmin\\Controllers\\Database\\Structure\\FavoriteTableController\:\:synchronizeFavoriteTables\(\) expects array\<mixed\>, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Database/Structure/FavoriteTableController.php
-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string

View File

@ -1208,7 +1208,6 @@
</DeprecatedMethod>
<MixedArgument>
<code><![CDATA[$favoriteTables]]></code>
<code><![CDATA[$favoriteTables]]></code>
</MixedArgument>
<MixedArrayAccess>
<code><![CDATA[$value['db']]]></code>
@ -1217,7 +1216,6 @@
<MixedArrayAssignment>
<code><![CDATA[$_SESSION['tmpval']['favorites_synced']]]></code>
<code><![CDATA[$_SESSION['tmpval']['favorites_synced'][Current::$server]]]></code>
<code><![CDATA[$favoriteTables[$user]]]></code>
</MixedArrayAssignment>
<MixedAssignment>
<code><![CDATA[$favoriteTables]]></code>

View File

@ -2548,3 +2548,7 @@ body .ui-dialog {
.table-responsive-md .data {
z-index: 9;
}
.bg-secondary {
color: #333;
}

View File

@ -20,7 +20,7 @@
</div>
<div class="col align-self-center text-end">
{% if collation.is_default %}
<span class="badge bg-secondary text-dark">{{ t('default', context = 'The collation is the default one') }}</span>
<span class="badge bg-secondary">{{ t('default', context = 'The collation is the default one') }}</span>
{% endif %}
</div>
</div>

View File

@ -14,7 +14,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.operation|lower != 'analyze' %}
<span class="badge bg-secondary text-dark">{{ row.operation|title }}</span>
<span class="badge bg-secondary">{{ row.operation|title }}</span>
{% endif %}
{% set badge_variation %}
@ -28,7 +28,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.type|title }}</span>
{{ row.text }}
</li>

View File

@ -14,7 +14,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.operation|lower != 'check' %}
<span class="badge bg-secondary text-dark">{{ row.operation|title }}</span>
<span class="badge bg-secondary">{{ row.operation|title }}</span>
{% endif %}
{% set badge_variation %}
@ -28,7 +28,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.type|title }}</span>
{{ row.text }}
</li>

View File

@ -14,7 +14,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.operation|lower != 'optimize' %}
<span class="badge bg-secondary text-dark">{{ row.operation|title }}</span>
<span class="badge bg-secondary">{{ row.operation|title }}</span>
{% endif %}
{% set badge_variation %}
@ -28,7 +28,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.type|title }}</span>
{{ row.text }}
</li>

View File

@ -14,7 +14,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.operation|lower != 'repair' %}
<span class="badge bg-secondary text-dark">{{ row.operation|title }}</span>
<span class="badge bg-secondary">{{ row.operation|title }}</span>
{% endif %}
{% set badge_variation %}
@ -28,7 +28,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.type|title }}</span>
{{ row.text }}
</li>

View File

@ -11,7 +11,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.Op|lower != 'analyze' %}
<span class="badge bg-secondary text-dark">{{ row.Op|title }}</span>
<span class="badge bg-secondary">{{ row.Op|title }}</span>
{% endif %}
{% set badge_variation %}
@ -25,7 +25,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.Msg_type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.Msg_type|title }}</span>
{{ row.Msg_text }}
</li>

View File

@ -11,7 +11,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.Op|lower != 'check' %}
<span class="badge bg-secondary text-dark">{{ row.Op|title }}</span>
<span class="badge bg-secondary">{{ row.Op|title }}</span>
{% endif %}
{% set badge_variation %}
@ -25,7 +25,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.Msg_type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.Msg_type|title }}</span>
{{ row.Msg_text }}
</li>

View File

@ -11,7 +11,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.Op|lower != 'optimize' %}
<span class="badge bg-secondary text-dark">{{ row.Op|title }}</span>
<span class="badge bg-secondary">{{ row.Op|title }}</span>
{% endif %}
{% set badge_variation %}
@ -25,7 +25,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.Msg_type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.Msg_type|title }}</span>
{{ row.Msg_text }}
</li>

View File

@ -11,7 +11,7 @@
{% for row in table %}
<li class="list-group-item">
{% if row.Op|lower != 'repair' %}
<span class="badge bg-secondary text-dark">{{ row.Op|title }}</span>
<span class="badge bg-secondary">{{ row.Op|title }}</span>
{% endif %}
{% set badge_variation %}
@ -25,7 +25,7 @@
bg-secondary
{%- endif -%}
{% endset %}
<span class="badge {{ badge_variation }} text-dark">{{ row.Msg_type|title }}</span>
<span class="badge {{ badge_variation }}">{{ row.Msg_type|title }}</span>
{{ row.Msg_text }}
</li>

View File

@ -22,6 +22,7 @@ use PhpMyAdmin\Template;
use function __;
use function count;
use function is_array;
use function json_decode;
use function json_encode;
use function md5;
@ -54,6 +55,10 @@ final class FavoriteTableController implements InvocableController
$favoriteTables = $request->getParam('favoriteTables');
$favoriteTables = $favoriteTables !== null ? json_decode($favoriteTables, true) : [];
if (! is_array($favoriteTables)) {
$favoriteTables = [];
}
// Required to keep each user's preferences separate.
$user = sha1($config->selectedServer['user']);

View File

@ -194,7 +194,7 @@ final class CreateController implements InvocableController
{
// If different column names defined for VIEW
$viewColumns = [];
if (isset($view['column_names'])) {
if (isset($view['column_names']) && $view['column_names'] !== '') {
$viewColumns = explode(',', $view['column_names']);
}

View File

@ -31,8 +31,8 @@ class Types
private const NULL_OPERATORS = ['IS NULL', 'IS NOT NULL'];
private const ENUM_OPERATORS = ['=', '!='];
private const TEXT_OPERATORS = [
'LIKE',
'LIKE %...%',
'LIKE',
'NOT LIKE',
'NOT LIKE %...%',
'=',

View File

@ -54,7 +54,7 @@ class CollationsControllerTest extends AbstractTestCase
self::assertStringContainsString('<div>cp1252 West European</div>', $actual);
self::assertStringContainsString('<div><strong>latin1_swedish_ci</strong></div>', $actual);
self::assertStringContainsString('<div>Swedish, case-insensitive</div>', $actual);
self::assertStringContainsString('<span class="badge bg-secondary text-dark">default</span>', $actual);
self::assertStringContainsString('<span class="badge bg-secondary">default</span>', $actual);
self::assertStringContainsString('<div><strong>utf8</strong></div>', $actual);
self::assertStringContainsString('<div>UTF-8 Unicode</div>', $actual);
self::assertStringContainsString('<div><strong>utf8_bin</strong></div>', $actual);

View File

@ -65,8 +65,8 @@ class TypesTest extends AbstractTestCase
'CHAR',
true,
[
'LIKE',
'LIKE %...%',
'LIKE',
'NOT LIKE',
'NOT LIKE %...%',
'=',