Skip to content

Commit 3e1971c

Browse files
authored
[no ci] fix findings 5
1 parent 9e11b73 commit 3e1971c

2 files changed

Lines changed: 19 additions & 21 deletions

File tree

.github/workflows/php-sast.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
- custom-defs.stub
3838
bootstrapFiles:
3939
- plugins/bcc-login/bcc-login.php
40+
ignoreErrors:
41+
- '#Function get_culture not found\.#'
42+
- '#Path in require\(\) "build/visibility\.asset\.php" is not a file or it does not exist\.#'
43+
- '#Path in require\(\) "build/settings\.asset\.php" is not a file or it does not exist\.#'
44+
excludePaths:
45+
- plugins/bcc-signon/openid-connect-bcc-customizations/access-token.php
4046
includes:
4147
- vendor/szepeviktor/phpstan-wordpress/extension.neon
4248
EOF
@@ -46,24 +52,16 @@ jobs:
4652
cat <<'EOF' > custom-defs.stub
4753
<?php
4854
49-
// Advanced Custom Fields stubs
50-
//if (!function_exists('get_field')) {
51-
/**
52-
* @param string $selector The field name or field key.
53-
* @param mixed $post_id Optional. Post ID, "option", false, or other ACF-supported context.
54-
* @param bool $format_value Optional. Whether to apply formatting logic. Default true.
55-
* @param bool $escape_html Optional. Whether to return escaped HTML.
56-
* Requires $format_value to be true. Default false.
57-
*
58-
* @return mixed|null The field value.
59-
*/
60-
function get_field(
61-
string $selector,
62-
$post_id = false,
63-
bool $format_value = true,
64-
bool $escape_html = false
65-
) {};
66-
//}
55+
/**
56+
* @param mixed $post_id
57+
* @return mixed|null
58+
*/
59+
function get_field(
60+
string $selector,
61+
$post_id = false,
62+
bool $format_value = true,
63+
bool $escape_html = false
64+
) {};
6765
EOF
6866
6967
- name: Install PHPStan and Wordpress-stub

plugins/bcc-login/snippets/login-scripts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
(function () {
1616
var webAuth = new auth0.WebAuth({
1717
domain: 'login.bcc.no',
18-
clientID: '<?= $clientID ?>',
19-
scope: '<?= $scope ?>',
18+
clientID: '<?= $clientID ?? '' ?>',
19+
scope: '<?= $scope ?? '' ?>',
2020
responseType: 'id_token',
2121
responseMode: 'fragment',
22-
redirectUri: location.origin + '/<?= $redirectPath ?>'
22+
redirectUri: location.origin + '/<?= $redirectPath ?? '' ?>'
2323
});
2424
setTimeout(function () {
2525
webAuth.checkSession({prompt: 'none'}, function (err, authResult) {

0 commit comments

Comments
 (0)