Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kleine Ergänzung #1

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/tests-visual/system_settings--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/tests-visual/system_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/tests-visual/system_settings_safemode--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/tests-visual/system_settings_safemode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="${{ matrix.db-image == 'mariadb:latest' && 'mariadb-admin' || 'mysqladmin' }} ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .tools/psalm/baseline-taint.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
<files psalm-version="5.14.0@b2942cefed8443002bd3f245c4cd0a54193716d8">
<file src="redaxo/src/addons/backup/lib/backup.php">
<TaintedFile>
<code>$filename</code>
Expand Down
42 changes: 41 additions & 1 deletion .tools/psalm/baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
<files psalm-version="5.14.0@b2942cefed8443002bd3f245c4cd0a54193716d8">
<file src="redaxo/src/addons/backup/lib/backup.php">
<MixedArgument>
<code>$column</code>
Expand Down Expand Up @@ -39,6 +39,14 @@
<code>$excludedTables</code>
<code>$filename</code>
</MixedAssignment>
<PossiblyInvalidOperand>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$filename</code>
</PossiblyInvalidOperand>
</file>
<file src="redaxo/src/addons/backup/pages/export.php">
<MixedArgument>
Expand Down Expand Up @@ -205,6 +213,9 @@
<MixedAssignment>
<code>$value</code>
</MixedAssignment>
<PossiblyInvalidArgument>
<code><![CDATA[str_replace($type . '_', '', $key)]]></code>
</PossiblyInvalidArgument>
</file>
<file src="redaxo/src/addons/cronjob/lib/manager_sql.php">
<ArgumentTypeCoercion>
Expand Down Expand Up @@ -1775,6 +1786,9 @@
</PossiblyNullReference>
</file>
<file src="redaxo/src/addons/structure/lib/navigation.php">
<ArgumentTypeCoercion>
<code>(string) $va</code>
</ArgumentTypeCoercion>
<MixedAssignment>
<code>$result</code>
<code>$result</code>
Expand Down Expand Up @@ -3226,6 +3240,9 @@
</file>
<file src="redaxo/src/core/functions/function_rex_escape.php">
<InvalidReturnStatement>
<code>$string</code>
<code>$string</code>
<code>$string</code>
<code>$value</code>
</InvalidReturnStatement>
<InvalidReturnType>
Expand Down Expand Up @@ -3986,6 +4003,12 @@
<code><![CDATA[$this->getValue($column)]]></code>
<code><![CDATA[$this->getValue($columnName)]]></code>
</ArgumentTypeCoercion>
<InvalidReturnStatement>
<code><![CDATA[str_replace('###' . $varname . '###', rex_escape((string) $this->getValue($varname)), $string)]]></code>
</InvalidReturnStatement>
<InvalidReturnType>
<code>string</code>
</InvalidReturnType>
<MixedArgument>
<code>$column</code>
<code>$column</code>
Expand Down Expand Up @@ -4073,6 +4096,12 @@
<code><![CDATA[$this->linkAttributes[$column] ?? $default]]></code>
<code><![CDATA[json_decode($this->getValue($column), true)]]></code>
</MixedReturnStatement>
<PossiblyInvalidArgument>
<code>$columnValue</code>
</PossiblyInvalidArgument>
<PossiblyInvalidOperand>
<code><![CDATA[str_replace('###VALUE###', $columnHead, $layout[0])]]></code>
</PossiblyInvalidOperand>
<PossiblyNullArgument>
<code>$columnLayout</code>
<code><![CDATA[$column['width'] ?? null]]></code>
Expand Down Expand Up @@ -5019,6 +5048,9 @@
<MixedArgument>
<code>$string</code>
</MixedArgument>
<PossiblyInvalidArgument>
<code>$string</code>
</PossiblyInvalidArgument>
</file>
<file src="redaxo/src/core/lib/util/string.php">
<MixedArgument>
Expand Down Expand Up @@ -5083,6 +5115,11 @@
<code>$var[$key]</code>
</MixedAssignment>
</file>
<file src="redaxo/src/core/lib/util/validator.php">
<ArgumentTypeCoercion>
<code>$regex</code>
</ArgumentTypeCoercion>
</file>
<file src="redaxo/src/core/lib/util/version.php">
<MixedArgument>
<code>$pos</code>
Expand Down Expand Up @@ -5123,6 +5160,9 @@
<code>$match[0]</code>
<code>$match[0]</code>
</MixedOperand>
<PossiblyInvalidArgument>
<code>$args</code>
</PossiblyInvalidArgument>
<PossiblyNullOperand>
<code>$then</code>
<code>$then</code>
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
"ext-mbstring": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "v3.20.0",
"friendsofphp/php-cs-fixer": "v3.22.0",
"friendsofredaxo/linter": "1.4.0",
"jetbrains/phpstorm-attributes": "^1.0",
"phpstan/extension-installer": "1.3.1",
"phpstan/phpstan": "1.10.22",
"phpstan/phpstan": "1.10.26",
"phpstan/phpstan-deprecation-rules": "1.1.3",
"phpstan/phpstan-phpunit": "1.3.13",
"phpstan/phpstan-symfony": "1.3.2",
"phpunit/phpunit": "^10.0.7",
"psalm/plugin-phpunit": "0.18.4",
"psalm/plugin-symfony": "v5.0.3",
"rector/rector": "0.17.2",
"rector/rector": "0.17.7",
"redaxo/php-cs-fixer-config": "2.2.0",
"redaxo/psalm-plugin": "2.0.0",
"vimeo/psalm": "5.13.1"
"vimeo/psalm": "5.14.0"
},
"replace": {
"erusev/parsedown": "1.7.4",
"erusev/parsedown-extra": "0.8.1",
"filp/whoops": "2.15.2",
"filp/whoops": "2.15.3",
"itsgoingd/clockwork": "v5.1.12",
"lbuchs/webauthn": "v1.1.3",
"phpmailer/phpmailer": "v6.8.0",
Expand All @@ -41,18 +41,18 @@
"ramsey/http-range": "1.1.0",
"scssphp/scssphp": "v1.11.0",
"splitbrain/php-archive": "1.3.1",
"symfony/console": "v6.3.0",
"symfony/console": "v6.3.2",
"symfony/deprecation-contracts": "v3.3.0",
"symfony/http-foundation": "v6.3.1",
"symfony/http-foundation": "v6.3.2",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php83": "v1.27.0",
"symfony/service-contracts": "v3.3.0",
"symfony/string": "v6.3.0",
"symfony/var-dumper": "v6.3.1",
"symfony/yaml": "v6.3.0",
"voku/anti-xss": "4.1.41",
"symfony/string": "v6.3.2",
"symfony/var-dumper": "v6.3.3",
"symfony/yaml": "v6.3.3",
"voku/anti-xss": "4.1.42",
"voku/portable-ascii": "2.0.1",
"voku/portable-utf8": "6.0.13"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute()
$disposition .= "; filename*=utf-8''" . rawurldecode(rex_media::get($this->media->getMediaFilename())->getOriginalFileName());
}

if ('noindex' === $this->params['index']) {
if ('noindex' === ($this->params['index'] ?? null)) {
$this->media->setHeader('X-Robots-Tag', 'noindex');
}

Expand Down
4 changes: 2 additions & 2 deletions redaxo/src/addons/media_manager/lib/effects/effect_resize.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public function execute()
return;
}

if (!isset($this->params['width'])) {
if (!isset($this->params['width']) || '' === $this->params['width']) {
$this->params['width'] = $w;
}

if (!isset($this->params['height'])) {
if (!isset($this->params['height']) || '' === $this->params['height']) {
$this->params['height'] = $h;
}

Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/addons/mediapool/pages/media.list.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'filename' => $fileName,
'category_id' => $rexFileCategory,
]));
} catch (rex_sql_exception $e) {
} catch (rex_sql_exception) {
$error = rex_i18n::msg('pool_selectedmedia_error');
}
}
Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/addons/structure/lib/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class rex_navigation
/** @var array<int, string> */
private array $linkclasses = [];
/** @var list<array{metafield: string, value: int|string, type: string, depth: int|''}> */
private array$filter = [];
private array $filter = [];
/**
* @var list<array{
* callback: callable(rex_category, int, array<int|string, int|string|list<string>>,array<int|string, int|string|list<string>>, string):bool,
Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/addons/structure/lib/service_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public static function editCategory($categoryId, $clang, array $data)
*/
public static function deleteCategory($categoryId)
{
$clang = 1;
$clang = rex_clang::getStartId();

$thisCat = rex_sql::factory();
$thisCat->setQuery('SELECT * FROM ' . rex::getTablePrefix() . 'article WHERE id=? and clang_id=?', [$categoryId, $clang]);
Expand Down
6 changes: 3 additions & 3 deletions redaxo/src/addons/structure/plugins/content/pages/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,20 @@
if (1 != $CM->getRows()) {
// ------------- MODUL IST NICHT VORHANDEN
$globalWarning = rex_i18n::msg('module_not_found');
$sliceId = '';
$sliceId = 0;
$function = '';
} else {
// ------------- MODUL IST VORHANDEN

// ----- RECHTE AM MODUL ?
if ('delete' != $function && !rex_template::hasModule($templateAttributes, $ctype, $moduleId)) {
$globalWarning = rex_i18n::msg('no_rights_to_this_function');
$sliceId = '';
$sliceId = 0;
$function = '';
} elseif (!$user->getComplexPerm('modules')->hasPerm($moduleId)) {
// ----- RECHTE AM MODUL: NEIN
$globalWarning = rex_i18n::msg('no_rights_to_this_function');
$sliceId = '';
$sliceId = 0;
$function = '';
} else {
// ----- RECHTE AM MODUL: JA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$action->insert();
$success = rex_i18n::msg('action_taken');
$goon = '1';
} catch (rex_sql_exception $e) {
} catch (rex_sql_exception) {
$error = $action->getError();
}
} elseif ('delete' == $functionAction) {
Expand Down
12 changes: 6 additions & 6 deletions redaxo/src/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"require": {
"erusev/parsedown": "^1.7.4",
"erusev/parsedown-extra": "^0.8.1",
"filp/whoops": "^2.15.2",
"filp/whoops": "^2.15.3",
"lbuchs/webauthn": "^1.1.3",
"psr/log": "^1.1.4",
"ramsey/http-range": "^1.1",
"symfony/console": "^6.3.0",
"symfony/http-foundation": "^6.3.1",
"symfony/var-dumper": "^6.3.1",
"symfony/yaml": "^6.3.0",
"voku/anti-xss": "^4.1.41"
"symfony/console": "^6.3.2",
"symfony/http-foundation": "^6.3.2",
"symfony/var-dumper": "^6.3.3",
"symfony/yaml": "^6.3.3",
"voku/anti-xss": "^4.1.42"
},

"replace": {
Expand Down
Loading