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

New website security const by website #32980

Merged
merged 29 commits into from
Feb 12, 2025
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e0be95f
New westite security constants
Hystepik Jan 29, 2025
180954e
fix php typo
Hystepik Jan 29, 2025
5fb1612
add remove div
Hystepik Jan 31, 2025
9bd9812
working select for content security policy
Hystepik Feb 4, 2025
b3f40b2
fix some naming and add comment
Hystepik Feb 7, 2025
7aa17b3
add all sources + modification for some
Hystepik Feb 7, 2025
da22c23
add translations
Hystepik Feb 7, 2025
d0e0c3b
fix elseif
Hystepik Feb 7, 2025
661bec8
fix translate
Hystepik Feb 7, 2025
5d02a42
add comment information
Hystepik Feb 7, 2025
00f30ba
Merge branch 'develop' into new-website-security-const
Hystepik Feb 7, 2025
3467a7b
Merge branch 'develop' into new-website-security-const
Hystepik Feb 10, 2025
44107c7
fix ci
Hystepik Feb 10, 2025
a6f39c8
Merge branch 'new-website-security-const' of github.com:Hystepik/doli…
Hystepik Feb 10, 2025
b3d80ea
fix CI
Hystepik Feb 10, 2025
bc54d4c
fix CI
Hystepik Feb 10, 2025
7d5929e
fix phpstan
Hystepik Feb 10, 2025
830d787
Update website.lib.php
eldy Feb 10, 2025
d3808a3
Update website.lib.php
eldy Feb 10, 2025
35689a2
Update website.lib.php
eldy Feb 10, 2025
9f55909
Merge branch 'develop' into new-website-security-const
eldy Feb 10, 2025
267053f
fix Ci
Hystepik Feb 10, 2025
21d22fc
Update index.php
eldy Feb 10, 2025
8e61c27
Update index.php
eldy Feb 10, 2025
1c24333
fix Ci
Hystepik Feb 11, 2025
cbf8d6a
Merge branch 'new-website-security-const' of github.com:Hystepik/doli…
Hystepik Feb 11, 2025
44807b1
Fix Ci + error
Hystepik Feb 11, 2025
8a1ff96
try fix CI
Hystepik Feb 11, 2025
435fce3
Merge branch 'develop' into new-website-security-const
Hystepik Feb 11, 2025
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
Prev Previous commit
Next Next commit
Update website.lib.php
  • Loading branch information
eldy authored Feb 10, 2025
commit 830d787e829b95873296e458e61d42588e76ec08
10 changes: 7 additions & 3 deletions htdocs/website/lib/website.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,27 @@

/**
* Transform a Content Security Policy to an array
* @param string $forceCSP content security policy
*
* @return array<non-falsy-string, array<'data'|int<0, max>, list<string>|string>> Array of sources
* @param string $forceCSP Content security policy tring

Check failure on line 192 in htdocs/website/lib/website.lib.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

tring ==> trying, string, ring
* @return array<string,array<string|int,array<string|int,string>|string>> Array of sources
*/
function websiteGetContentPolicyToArray($forceCSP)
{
$forceCSPArr = array();
$sourceCSPArr = websiteGetContentPolicySources();
$sourceCSPArrflatten = array();

Check failure on line 200 in htdocs/website/lib/website.lib.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Whitespace found at end of line
// We remove a level for sources array
foreach ($sourceCSPArr as $key => $arr) {
$sourceCSPArrflatten = array_merge($sourceCSPArrflatten, array_keys($arr));
}
$securitypolicies = explode(";", $forceCSP);

Check failure on line 206 in htdocs/website/lib/website.lib.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Whitespace found at end of line
// Loop on each security policy to create an array
foreach ($securitypolicies as $key => $securitypolicy) {
if ($securitypolicy == "") continue;
if ($securitypolicy == "") {
continue;
}
$securitypolicyarr = explode(" ", $securitypolicy);
$directive = array_shift($securitypolicyarr);
// Remove unwanted spaces
Expand Down
Loading