Skip to content

Commit

Permalink
Merge branch 'bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Jul 1, 2023
2 parents 25b6602 + 70b3ede commit f18822c
Show file tree
Hide file tree
Showing 188 changed files with 3,027 additions and 927 deletions.
1 change: 0 additions & 1 deletion .github/workflows/unit-tests.yml
Expand Up @@ -43,7 +43,6 @@ jobs:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/visual-tests.yml
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Add action run link to trigger comment
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
if: github.event_name == 'repository_dispatch'
with:
token: ${{ secrets.BOT_TOKEN }}
Expand Down
46 changes: 18 additions & 28 deletions .tools/phpstan/baseline.neon
@@ -1,15 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Result of && is always false\\.$#"
count: 1
path: ../../redaxo/src/addons/backup/lib/backup.php

-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: ../../redaxo/src/addons/backup/lib/backup.php

-
message: "#^Method rex_cronjob_export\\:\\:getParamFields\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -506,12 +496,12 @@ parameters:
path: ../../redaxo/src/addons/mediapool/lib/media.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_media\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_media\\)\\|null\\)\\|null, Closure\\(mixed\\)\\: static\\(rex_media\\)\\|null given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_media\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\)\\)\\|null, Closure\\(mixed\\)\\: \\(static\\|null\\) given\\.$#"
count: 1
path: ../../redaxo/src/addons/mediapool/lib/media.php

-
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_media\\:\\:getInstanceList\\(\\) expects callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_media\\)\\|null, callable\\(string\\)\\: static\\(rex_media\\) given\\.$#"
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_media\\:\\:getInstanceList\\(\\) expects callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\), callable\\(string\\)\\: static given\\.$#"
count: 1
path: ../../redaxo/src/addons/mediapool/lib/media.php

Expand All @@ -531,22 +521,22 @@ parameters:
path: ../../redaxo/src/addons/mediapool/lib/media_category.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_media_category\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_media_category\\)\\|null\\)\\|null, Closure\\(mixed\\)\\: static\\(rex_media_category\\)\\|null given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_media_category\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\)\\)\\|null, Closure\\(mixed\\)\\: \\(static\\|null\\) given\\.$#"
count: 1
path: ../../redaxo/src/addons/mediapool/lib/media_category.php

-
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_media_category\\:\\:getInstanceList\\(\\) expects callable\\(\\.\\.\\.mixed\\)\\: rex_media\\|null, Closure\\(string\\)\\: rex_media\\|null given\\.$#"
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_media_category\\:\\:getInstanceList\\(\\) expects callable\\(mixed \\.\\.\\.\\)\\: \\(rex_media\\|null\\), Closure\\(string\\)\\: \\(rex_media\\|null\\) given\\.$#"
count: 1
path: ../../redaxo/src/addons/mediapool/lib/media_category.php

-
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_media_category\\:\\:getInstanceList\\(\\) expects callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_media_category\\)\\|null, Closure\\(int\\)\\: static\\(rex_media_category\\)\\|null given\\.$#"
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_media_category\\:\\:getInstanceList\\(\\) expects callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\), Closure\\(int\\)\\: \\(static\\|null\\) given\\.$#"
count: 1
path: ../../redaxo/src/addons/mediapool/lib/media_category.php

-
message: "#^Parameter \\#3 \\$createListCallback of static method rex_media_category\\:\\:getInstanceList\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: array\\)\\|null, Closure\\(mixed\\)\\: array given\\.$#"
message: "#^Parameter \\#3 \\$createListCallback of static method rex_media_category\\:\\:getInstanceList\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: array\\)\\|null, Closure\\(mixed\\)\\: array given\\.$#"
count: 2
path: ../../redaxo/src/addons/mediapool/lib/media_category.php

Expand Down Expand Up @@ -1161,17 +1151,17 @@ parameters:
path: ../../redaxo/src/addons/structure/lib/structure_element.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_structure_element\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_structure_element\\)\\|null\\)\\|null, Closure\\(mixed, mixed\\)\\: static\\(rex_structure_element\\)\\|null given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_structure_element\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\)\\)\\|null, Closure\\(mixed, mixed\\)\\: \\(static\\|null\\) given\\.$#"
count: 1
path: ../../redaxo/src/addons/structure/lib/structure_element.php

-
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_structure_element\\:\\:getInstanceList\\(\\) expects callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_structure_element\\)\\|null, Closure\\(mixed\\)\\: static\\(rex_structure_element\\)\\|null given\\.$#"
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_structure_element\\:\\:getInstanceList\\(\\) expects callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\), Closure\\(mixed\\)\\: \\(static\\|null\\) given\\.$#"
count: 1
path: ../../redaxo/src/addons/structure/lib/structure_element.php

-
message: "#^Parameter \\#3 \\$createListCallback of static method rex_structure_element\\:\\:getInstanceList\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: array\\)\\|null, Closure\\(mixed, mixed\\)\\: array given\\.$#"
message: "#^Parameter \\#3 \\$createListCallback of static method rex_structure_element\\:\\:getInstanceList\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: array\\)\\|null, Closure\\(mixed, mixed\\)\\: array given\\.$#"
count: 1
path: ../../redaxo/src/addons/structure/lib/structure_element.php

Expand Down Expand Up @@ -2071,7 +2061,7 @@ parameters:
path: ../../redaxo/src/core/lib/login/user.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_user\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_user\\)\\|null\\)\\|null, Closure\\(int\\)\\: static\\(rex_user\\)\\|null given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_user\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\)\\)\\|null, Closure\\(int\\)\\: \\(static\\|null\\) given\\.$#"
count: 1
path: ../../redaxo/src/core/lib/login/user.php

Expand Down Expand Up @@ -2496,7 +2486,7 @@ parameters:
path: ../../redaxo/src/core/lib/sql/table.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_sql_table\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: static\\(rex_sql_table\\)\\|null\\)\\|null, Closure\\(int, string\\)\\: static\\(rex_sql_table\\) given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_sql_table\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(static\\|null\\)\\)\\|null, Closure\\(int, string\\)\\: static given\\.$#"
count: 1
path: ../../redaxo/src/core/lib/sql/table.php

Expand Down Expand Up @@ -2766,22 +2756,22 @@ parameters:
path: ../../redaxo/src/core/tests/base/instance_list_pool_trait_test.php

-
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects callable\\(\\.\\.\\.mixed\\)\\: object\\|null, Closure\\(mixed, mixed\\)\\: void given\\.$#"
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects callable\\(mixed \\.\\.\\.\\)\\: \\(object\\|null\\), Closure\\(mixed, mixed\\)\\: void given\\.$#"
count: 1
path: ../../redaxo/src/core/tests/base/instance_list_pool_trait_test.php

-
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects callable\\(\\.\\.\\.mixed\\)\\: rex_test_instance_list_pool\\|null, Closure\\(int\\)\\: rex_test_instance_list_pool given\\.$#"
message: "#^Parameter \\#2 \\$getInstanceCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects callable\\(mixed \\.\\.\\.\\)\\: \\(rex_test_instance_list_pool\\|null\\), Closure\\(int\\)\\: rex_test_instance_list_pool given\\.$#"
count: 4
path: ../../redaxo/src/core/tests/base/instance_list_pool_trait_test.php

-
message: "#^Parameter \\#3 \\$createListCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: array\\)\\|null, Closure\\(mixed\\)\\: array\\{1, 2\\} given\\.$#"
message: "#^Parameter \\#3 \\$createListCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: array\\)\\|null, Closure\\(mixed\\)\\: array\\{1, 2\\} given\\.$#"
count: 1
path: ../../redaxo/src/core/tests/base/instance_list_pool_trait_test.php

-
message: "#^Parameter \\#3 \\$createListCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: array\\)\\|null, Closure\\(mixed, mixed\\)\\: array\\{\\} given\\.$#"
message: "#^Parameter \\#3 \\$createListCallback of static method rex_test_instance_list_pool\\:\\:getInstanceList\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: array\\)\\|null, Closure\\(mixed, mixed\\)\\: array\\{\\} given\\.$#"
count: 1
path: ../../redaxo/src/core/tests/base/instance_list_pool_trait_test.php

Expand All @@ -2796,17 +2786,17 @@ parameters:
path: ../../redaxo/src/core/tests/base/instance_list_pool_trait_test.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_test_instance_pool_base\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: rex_test_instance_pool_1\\|null\\)\\|null, Closure\\(mixed\\)\\: rex_test_instance_pool_1 given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_test_instance_pool_base\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(rex_test_instance_pool_1\\|null\\)\\)\\|null, Closure\\(mixed\\)\\: rex_test_instance_pool_1 given\\.$#"
count: 1
path: ../../redaxo/src/core/tests/base/instance_pool_trait_test.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_test_instance_pool_base\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: rex_test_instance_pool_1\\|null\\)\\|null, Closure\\(mixed, mixed\\)\\: void given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_test_instance_pool_base\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(rex_test_instance_pool_1\\|null\\)\\)\\|null, Closure\\(mixed, mixed\\)\\: void given\\.$#"
count: 1
path: ../../redaxo/src/core/tests/base/instance_pool_trait_test.php

-
message: "#^Parameter \\#2 \\$createCallback of static method rex_test_instance_pool_base\\:\\:getInstance\\(\\) expects \\(callable\\(\\.\\.\\.mixed\\)\\: rex_test_instance_pool_2\\|null\\)\\|null, Closure\\(mixed\\)\\: rex_test_instance_pool_2 given\\.$#"
message: "#^Parameter \\#2 \\$createCallback of static method rex_test_instance_pool_base\\:\\:getInstance\\(\\) expects \\(callable\\(mixed \\.\\.\\.\\)\\: \\(rex_test_instance_pool_2\\|null\\)\\)\\|null, Closure\\(mixed\\)\\: rex_test_instance_pool_2 given\\.$#"
count: 1
path: ../../redaxo/src/core/tests/base/instance_pool_trait_test.php

Expand Down
2 changes: 1 addition & 1 deletion .tools/psalm/baseline-taint.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.11.0@c9b192ab8400fdaf04b2b13d110575adc879aa90">
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
<file src="redaxo/src/addons/backup/lib/backup.php">
<TaintedFile>
<code>$filename</code>
Expand Down
85 changes: 12 additions & 73 deletions .tools/psalm/baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.11.0@c9b192ab8400fdaf04b2b13d110575adc879aa90">
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
<file src="redaxo/src/addons/backup/lib/backup.php">
<MixedArgument>
<code>$column</code>
Expand Down Expand Up @@ -70,10 +70,6 @@
<code><![CDATA[$_FILES['FORM']['tmp_name']['importfile']]]></code>
<code><![CDATA[$_FILES['FORM']['tmp_name']['importfile']]]></code>
</MixedArgument>
<PossiblyFalseOperand>
<code>$filec</code>
<code>$filec</code>
</PossiblyFalseOperand>
</file>
<file src="redaxo/src/addons/backup/pages/import.upload.php">
<InvalidArrayAccess>
Expand Down Expand Up @@ -107,10 +103,6 @@
<code><![CDATA[$_SESSION['codemirror_reload']]]></code>
<code><![CDATA[$_SESSION['codemirror_reload']]]></code>
</MixedOperand>
<PossiblyFalseOperand>
<code><![CDATA[date('D, j M Y', strtotime('+1 week'))]]></code>
<code><![CDATA[date('D, j M Y', strtotime('+1 week'))]]></code>
</PossiblyFalseOperand>
<PossiblyNullOperand>
<code>rex_file::get($filename)</code>
<code>rex_file::get($filename)</code>
Expand Down Expand Up @@ -494,6 +486,11 @@
<code>addDatabaseQuery</code>
<code>addDatabaseQuery</code>
</MixedMethodCall>
<PossiblyUndefinedArrayOffset>
<code><![CDATA[$trace[$i]['line']]]></code>
<code><![CDATA[$trace[0]['file']]]></code>
<code><![CDATA[$trace[0]['line']]]></code>
</PossiblyUndefinedArrayOffset>
</file>
<file src="redaxo/src/addons/install/lib/api/api_core_update.php">
<MixedArgument>
Expand Down Expand Up @@ -858,6 +855,12 @@
<code><![CDATA[$this->params['rotate']]]></code>
</MixedArgument>
</file>
<file src="redaxo/src/addons/media_manager/lib/managed_media.php">
<RedundantCast>
<code>(int) $size[0]</code>
<code>(int) $size[1]</code>
</RedundantCast>
</file>
<file src="redaxo/src/addons/media_manager/lib/media_manager.php">
<MixedAssignment>
<code><![CDATA[$effparams[str_replace('rex_effect_' . $effname . '_', '', $name)]]]></code>
Expand Down Expand Up @@ -942,9 +945,6 @@
</MixedOperand>
</file>
<file src="redaxo/src/addons/mediapool/lib/media.php">
<InvalidAttribute>
<code>AllowDynamicProperties</code>
</InvalidAttribute>
<MixedArgument>
<code>$filename</code>
<code>$name</code>
Expand Down Expand Up @@ -1032,23 +1032,10 @@
</MixedReturnStatement>
</file>
<file src="redaxo/src/addons/mediapool/lib/service_media.php">
<MixedArgument>
<code><![CDATA[$data['file']['type']]]></code>
<code><![CDATA[$data['height']]]></code>
<code><![CDATA[$data['width']]]></code>
<code>$size[0]</code>
<code>$size[1]</code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code>$allowedExtensions</code>
<code>rex_mediapool::getBlockedExtensions()</code>
</MixedArgumentTypeCoercion>
<MixedAssignment>
<code><![CDATA[$data['file']['type']]]></code>
<code><![CDATA[$data['height']]]></code>
<code><![CDATA[$data['width']]]></code>
<code><![CDATA[$return['type']]]></code>
</MixedAssignment>
<PossiblyNullOperand>
<code><![CDATA[rex_file::mimeType($data['file']['path'])]]></code>
</PossiblyNullOperand>
Expand Down Expand Up @@ -1215,10 +1202,6 @@
<InvalidArgument>
<code>$data</code>
</InvalidArgument>
<MixedArgument>
<code>$size[0]</code>
<code>$size[1]</code>
</MixedArgument>
</file>
<file src="redaxo/src/addons/mediapool/pages/upload.php">
<MixedArgument>
Expand Down Expand Up @@ -1955,9 +1938,6 @@
</MixedAssignment>
</file>
<file src="redaxo/src/addons/structure/lib/structure_element.php">
<InvalidAttribute>
<code>AllowDynamicProperties</code>
</InvalidAttribute>
<MixedArgument>
<code>$clang</code>
<code>$id</code>
Expand Down Expand Up @@ -3498,9 +3478,6 @@
</MixedMethodCall>
</file>
<file src="redaxo/src/core/lib/clang/clang.php">
<InvalidAttribute>
<code>AllowDynamicProperties</code>
</InvalidAttribute>
<MixedArrayAccess>
<code><![CDATA[$data['priority']]]></code>
<code><![CDATA[$data['status']]]></code>
Expand Down Expand Up @@ -4117,9 +4094,6 @@
<ArgumentTypeCoercion>
<code>$password</code>
</ArgumentTypeCoercion>
<InvalidAttribute>
<code>SensitiveParameter</code>
</InvalidAttribute>
<MixedArgument>
<code><![CDATA[rex::getProperty('session_duration')]]></code>
</MixedArgument>
Expand Down Expand Up @@ -4151,11 +4125,6 @@
<ArgumentTypeCoercion>
<code>$previousPasswords</code>
</ArgumentTypeCoercion>
<InvalidAttribute>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
</InvalidAttribute>
<MixedArgument>
<code>$previousPasswords</code>
</MixedArgument>
Expand All @@ -4172,15 +4141,6 @@
</MixedAssignment>
</file>
<file src="redaxo/src/core/lib/login/login.php">
<InvalidAttribute>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
</InvalidAttribute>
<MixedArrayAccess>
<code><![CDATA[$_SESSION[static::getSessionNamespace()][$this->systemId]]]></code>
<code>$sessionConfig[$key]</code>
Expand Down Expand Up @@ -4219,10 +4179,6 @@
</PossiblyNullArgument>
</file>
<file src="redaxo/src/core/lib/login/password_policy.php">
<InvalidAttribute>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
</InvalidAttribute>
<PossiblyNullArgument>
<code><![CDATA[$this->getDescription()]]></code>
</PossiblyNullArgument>
Expand All @@ -4249,9 +4205,6 @@
<ArgumentTypeCoercion>
<code>$role</code>
</ArgumentTypeCoercion>
<InvalidAttribute>
<code>SensitiveParameter</code>
</InvalidAttribute>
<LessSpecificReturnStatement>
<code><![CDATA[$this->sql->getValue($key)]]></code>
<code><![CDATA[$this->sql->getValue('email')]]></code>
Expand Down Expand Up @@ -4670,16 +4623,6 @@
<code><![CDATA[$this->getValue($column)]]></code>
<code>$value</code>
</ArgumentTypeCoercion>
<InvalidAttribute>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
</InvalidAttribute>
<LessSpecificReturnStatement>
<code><![CDATA[$sql->getValue('Create Table')]]></code>
</LessSpecificReturnStatement>
Expand Down Expand Up @@ -5021,10 +4964,6 @@
}
}]]></code>
</InvalidArgument>
<InvalidAttribute>
<code>SensitiveParameter</code>
<code>SensitiveParameter</code>
</InvalidAttribute>
<MixedArgument>
<code><![CDATA[$parts['host']]]></code>
<code><![CDATA[$parts['path']]]></code>
Expand Down

0 comments on commit f18822c

Please sign in to comment.