Skip to content

Commit 1755556

Browse files
committed
Merge branch 'master' into release
2 parents 01cdbdb + 05ef23d commit 1755556

File tree

378 files changed

+7014
-2972
lines changed

Some content is hidden

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

378 files changed

+7014
-2972
lines changed

.env.example.complete

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ REVISION_LIMIT=50
293293
# Set to -1 for unlimited recycle bin lifetime.
294294
RECYCLE_BIN_LIFETIME=30
295295

296+
# File Upload Limit
297+
# Maximum file size, in megabytes, that can be uploaded to the system.
298+
FILE_UPLOAD_SIZE_LIMIT=50
299+
296300
# Allow <script> tags in page content
297301
# Note, if set to 'true' the page editor may still escape scripts.
298302
ALLOW_CONTENT_SCRIPTS=false

.github/translators.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,6 @@ Indrek Haav (IndrekHaav) :: Estonian
196196
na3shkw :: Japanese
197197
Giancarlo Di Massa (digitall-it) :: Italian
198198
M Nafis Al Mukhdi (mnafisalmukhdi1) :: Indonesian
199+
sulfo :: Danish
200+
Raukze :: German
201+
zygimantus :: Lithuanian

.github/workflows/phpstan.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: phpstan
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- l10n_master
7+
pull_request:
8+
branches-ignore:
9+
- l10n_master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-20.04
14+
strategy:
15+
matrix:
16+
php: ['7.3']
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
extensions: gd, mbstring, json, curl, xml, mysql, ldap
25+
26+
- name: Get Composer Cache Directory
27+
id: composer-cache
28+
run: |
29+
echo "::set-output name=dir::$(composer config cache-files-dir)"
30+
31+
- name: Cache composer packages
32+
uses: actions/cache@v1
33+
with:
34+
path: ${{ steps.composer-cache.outputs.dir }}
35+
key: ${{ runner.os }}-composer-${{ matrix.php }}
36+
37+
- name: Install composer dependencies
38+
run: composer install --prefer-dist --no-interaction --ansi
39+
40+
- name: Run PHPStan
41+
run: php${{ matrix.php }} ./vendor/bin/phpstan analyse --memory-limit=2G

.github/workflows/phpunit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
runs-on: ubuntu-20.04
1414
strategy:
1515
matrix:
16-
php: ['7.3', '7.4', '8.0']
16+
php: ['7.3', '7.4', '8.0', '8.1']
1717
steps:
1818
- uses: actions/checkout@v1
1919

2020
- name: Setup PHP
21-
uses: shivammathur/setup-php@b7d1d9c9a92d8d8463ce36d7f60da34d461724f8
21+
uses: shivammathur/setup-php@v2
2222
with:
2323
php-version: ${{ matrix.php }}
2424
extensions: gd, mbstring, json, curl, xml, mysql, ldap
@@ -45,7 +45,7 @@ jobs:
4545
mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
4646
mysql -uroot -proot -e 'FLUSH PRIVILEGES;'
4747
48-
- name: Install composer dependencies & Test
48+
- name: Install composer dependencies
4949
run: composer install --prefer-dist --no-interaction --ansi
5050

5151
- name: Migrate and seed the database

.github/workflows/test-migrations.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
runs-on: ubuntu-20.04
1414
strategy:
1515
matrix:
16-
php: ['7.3', '7.4', '8.0']
16+
php: ['7.3', '7.4', '8.0', '8.1']
1717
steps:
1818
- uses: actions/checkout@v1
1919

2020
- name: Setup PHP
21-
uses: shivammathur/setup-php@b7d1d9c9a92d8d8463ce36d7f60da34d461724f8
21+
uses: shivammathur/setup-php@v2
2222
with:
2323
php-version: ${{ matrix.php }}
2424
extensions: gd, mbstring, json, curl, xml, mysql, ldap

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ nbproject
2323
.settings/
2424
webpack-stats.json
2525
.phpunit.result.cache
26-
.DS_Store
26+
.DS_Store
27+
phpstan.neon

app/Actions/Activity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function isForEntity(): bool
6161
/**
6262
* Checks if another Activity matches the general information of another.
6363
*/
64-
public function isSimilarTo(Activity $activityB): bool
64+
public function isSimilarTo(self $activityB): bool
6565
{
6666
return [$this->type, $this->entity_type, $this->entity_id] === [$activityB->type, $activityB->entity_type, $activityB->entity_id];
6767
}

app/Actions/Comment.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use BookStack\Model;
66
use BookStack\Traits\HasCreatorAndUpdater;
7+
use Illuminate\Database\Eloquent\Factories\HasFactory;
78
use Illuminate\Database\Eloquent\Relations\MorphTo;
89

910
/**
@@ -15,6 +16,7 @@
1516
*/
1617
class Comment extends Model
1718
{
19+
use HasFactory;
1820
use HasCreatorAndUpdater;
1921

2022
protected $fillable = ['text', 'parent_id'];

app/Actions/CommentRepo.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ public function commentToHtml(string $commentText): string
9090
*/
9191
protected function getNextLocalId(Entity $entity): int
9292
{
93-
$comments = $entity->comments(false)->orderBy('local_id', 'desc')->first();
93+
/** @var Comment $comment */
94+
$comment = $entity->comments(false)->orderBy('local_id', 'desc')->first();
9495

95-
return ($comments->local_id ?? 0) + 1;
96+
return ($comment->local_id ?? 0) + 1;
9697
}
9798
}

app/Actions/Tag.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
namespace BookStack\Actions;
44

55
use BookStack\Model;
6+
use Illuminate\Database\Eloquent\Factories\HasFactory;
67
use Illuminate\Database\Eloquent\Relations\MorphTo;
78

9+
/**
10+
* @property int $id
11+
* @property string $name
12+
* @property string $value
13+
* @property int $order
14+
*/
815
class Tag extends Model
916
{
17+
use HasFactory;
18+
1019
protected $fillable = ['name', 'value', 'order'];
1120
protected $hidden = ['id', 'entity_id', 'entity_type', 'created_at', 'updated_at'];
1221

0 commit comments

Comments
 (0)