Skip to content

Commit 80374ae

Browse files
committed
Merge branch 'development' into release
2 parents 2ac9efa + aec772c commit 80374ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+585
-446
lines changed

.github/translators.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Alexander Predl (Harveyhase68) :: German
176176
Rem (Rem9000) :: Dutch
177177
Michał Stelmach (stelmach-web) :: Polish
178178
arniom :: French
179-
REMOVED_USER :: Dutch; Turkish
179+
REMOVED_USER :: ; Dutch; Turkish
180180
林祖年 (contagion) :: Chinese Traditional
181181
Siamak Guodarzi (siamakgoudarzi88) :: Persian
182182
Lis Maestrelo (lismtrl) :: Portuguese, Brazilian
@@ -274,3 +274,9 @@ Mihai Ochian (soulstorm19) :: Romanian
274274
HeartCore :: German Informal; German
275275
simon.pct :: French
276276
okaeiz :: Persian
277+
Naoto Ishikawa (na3shkw) :: Japanese
278+
sdhadi :: Persian
279+
DerLinkman (derlinkman) :: German; German Informal
280+
TurnArabic :: Arabic
281+
Martin Sebek (sebekmartin) :: Czech
282+
Kuchinashi Hoshikawa (kuchinashi) :: Chinese Simplified
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
name: phpstan
1+
name: analyse-php
22

33
on: [push, pull_request]
44

55
jobs:
66
build:
77
if: ${{ github.ref != 'refs/heads/l10n_development' }}
8-
runs-on: ubuntu-20.04
9-
strategy:
10-
matrix:
11-
php: ['7.4']
8+
runs-on: ubuntu-22.04
129
steps:
1310
- uses: actions/checkout@v1
1411

1512
- name: Setup PHP
1613
uses: shivammathur/setup-php@v2
1714
with:
18-
php-version: ${{ matrix.php }}
15+
php-version: 8.1
1916
extensions: gd, mbstring, json, curl, xml, mysql, ldap
2017

2118
- name: Get Composer Cache Directory
@@ -24,13 +21,14 @@ jobs:
2421
echo "::set-output name=dir::$(composer config cache-files-dir)"
2522
2623
- name: Cache composer packages
27-
uses: actions/cache@v1
24+
uses: actions/cache@v2
2825
with:
2926
path: ${{ steps.composer-cache.outputs.dir }}
30-
key: ${{ runner.os }}-composer-${{ matrix.php }}
27+
key: ${{ runner.os }}-composer-8.1
28+
restore-keys: ${{ runner.os }}-composer-
3129

3230
- name: Install composer dependencies
3331
run: composer install --prefer-dist --no-interaction --ansi
3432

35-
- name: Run PHPStan
36-
run: php${{ matrix.php }} ./vendor/bin/phpstan analyse --memory-limit=2G
33+
- name: Run static analysis check
34+
run: composer check-static

.github/workflows/lint-php.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: lint-php
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
if: ${{ github.ref != 'refs/heads/l10n_development' }}
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@v1
11+
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: 8.1
16+
tools: phpcs
17+
18+
- name: Run formatting check
19+
run: composer lint

.github/workflows/test-migrations.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: [push, pull_request]
55
jobs:
66
build:
77
if: ${{ github.ref != 'refs/heads/l10n_development' }}
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99
strategy:
1010
matrix:
1111
php: ['7.4', '8.0', '8.1']
@@ -24,10 +24,11 @@ jobs:
2424
echo "::set-output name=dir::$(composer config cache-files-dir)"
2525
2626
- name: Cache composer packages
27-
uses: actions/cache@v1
27+
uses: actions/cache@v2
2828
with:
2929
path: ${{ steps.composer-cache.outputs.dir }}
3030
key: ${{ runner.os }}-composer-${{ matrix.php }}
31+
restore-keys: ${{ runner.os }}-composer-
3132

3233
- name: Start MySQL
3334
run: |

.github/workflows/phpunit.yml renamed to .github/workflows/test-php.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: phpunit
1+
name: test-php
22

33
on: [push, pull_request]
44

55
jobs:
66
build:
77
if: ${{ github.ref != 'refs/heads/l10n_development' }}
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99
strategy:
1010
matrix:
1111
php: ['7.4', '8.0', '8.1']
@@ -24,10 +24,11 @@ jobs:
2424
echo "::set-output name=dir::$(composer config cache-files-dir)"
2525
2626
- name: Cache composer packages
27-
uses: actions/cache@v1
27+
uses: actions/cache@v2
2828
with:
2929
path: ${{ steps.composer-cache.outputs.dir }}
3030
key: ${{ runner.os }}-composer-${{ matrix.php }}
31+
restore-keys: ${{ runner.os }}-composer-
3132

3233
- name: Start Database
3334
run: |
@@ -48,5 +49,5 @@ jobs:
4849
php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing
4950
php${{ matrix.php }} artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing
5051
51-
- name: phpunit
52+
- name: Run PHP tests
5253
run: php${{ matrix.php }} ./vendor/bin/phpunit

app/Actions/Webhook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
*/
2323
class Webhook extends Model implements Loggable
2424
{
25-
protected $fillable = ['name', 'endpoint', 'timeout'];
26-
2725
use HasFactory;
2826

27+
protected $fillable = ['name', 'endpoint', 'timeout'];
28+
2929
protected $casts = [
3030
'last_called_at' => 'datetime',
3131
'last_errored_at' => 'datetime',

app/Actions/WebhookTrackedEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class WebhookTrackedEvent extends Model
1414
{
15-
protected $fillable = ['event'];
16-
1715
use HasFactory;
16+
17+
protected $fillable = ['event'];
1818
}

app/Auth/Access/LdapService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getUserDetails(string $userName): ?array
105105
'name' => $this->getUserResponseProperty($user, $displayNameAttr, $userCn),
106106
'dn' => $user['dn'],
107107
'email' => $this->getUserResponseProperty($user, $emailAttr, null),
108-
'avatar'=> $thumbnailAttr ? $this->getUserResponseProperty($user, $thumbnailAttr, null) : null,
108+
'avatar' => $thumbnailAttr ? $this->getUserResponseProperty($user, $thumbnailAttr, null) : null,
109109
];
110110

111111
if ($this->config['dump_user_details']) {

app/Auth/Access/Oidc/OidcService.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@
22

33
namespace BookStack\Auth\Access\Oidc;
44

5-
use function auth;
65
use BookStack\Auth\Access\GroupSyncService;
76
use BookStack\Auth\Access\LoginService;
87
use BookStack\Auth\Access\RegistrationService;
98
use BookStack\Auth\User;
109
use BookStack\Exceptions\JsonDebugException;
1110
use BookStack\Exceptions\StoppedAuthenticationException;
1211
use BookStack\Exceptions\UserRegistrationException;
13-
use function config;
1412
use Illuminate\Support\Arr;
1513
use Illuminate\Support\Facades\Cache;
1614
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
1715
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
1816
use Psr\Http\Client\ClientInterface as HttpClient;
19-
use function trans;
20-
use function url;
2117

2218
/**
2319
* Class OpenIdConnectService

app/Auth/Access/Saml2Service.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ public function processAcsResponse(?string $requestId, string $samlResponse): ?U
109109
$errors = $toolkit->getErrors();
110110

111111
if (!empty($errors)) {
112-
throw new Error(
113-
'Invalid ACS Response: ' . implode(', ', $errors)
114-
);
112+
$reason = $toolkit->getLastErrorReason();
113+
$message = 'Invalid ACS Response; Errors: ' . implode(', ', $errors);
114+
$message .= $reason ? "; Reason: {$reason}" : '';
115+
throw new Error($message);
115116
}
116117

117118
if (!$toolkit->isAuthenticated()) {

0 commit comments

Comments
 (0)