From d48ac0a37d0daafe2ba11255488d9c6233d73fef Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 26 Sep 2020 18:24:05 +0100 Subject: [PATCH 1/7] Removed redundant test Now replaced in recent commit by one that checks actual message gets displayed on the redirect page. Redirect page changed to login page. --- tests/Auth/Saml2Test.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/Auth/Saml2Test.php b/tests/Auth/Saml2Test.php index d58162497..58c02b471 100644 --- a/tests/Auth/Saml2Test.php +++ b/tests/Auth/Saml2Test.php @@ -196,24 +196,6 @@ class Saml2Test extends TestCase }); } - public function test_user_registration_with_existing_email() - { - config()->set([ - 'saml2.onelogin.strict' => false, - ]); - - $viewer = $this->getViewer(); - $viewer->email = 'user@example.com'; - $viewer->save(); - - $this->withPost(['SAMLResponse' => $this->acsPostData], function () { - $acsPost = $this->post('/saml2/acs'); - $acsPost->assertRedirect('/'); - $errorMessage = session()->get('error'); - $this->assertEquals('A user with the email user@example.com already exists but with different credentials.', $errorMessage); - }); - } - public function test_saml_routes_are_only_active_if_saml_enabled() { config()->set(['auth.method' => 'standard']); From 1e88e8086f9db19ae7782b12f06e9c47dd772240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Wed, 23 Sep 2020 01:22:03 +0200 Subject: [PATCH 2/7] Fixed canonical redirects on non-root url app instances If BookStack instance is deployed to any non-root path, e.g. http://example.com/wiki/, requests for http://example.com/wiki/shelves/ was redirected to http://example.com/shelves instead of http://example.com/wiki/shelves Synced with: https://github.com/laravel/laravel/blob/master/public/.htaccess --- public/.htaccess | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/.htaccess b/public/.htaccess index abe87b39d..3aec5e27e 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -11,9 +11,10 @@ # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.*)/$ /$1 [L,R=301] + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] - # Handle Front Controller... + # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] From 8b0f5e700044d7878b96b8322389bd7830e0e780 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Mon, 28 Sep 2020 20:45:38 +0100 Subject: [PATCH 3/7] Updated draw.io references to diagrams.net Related to #2044 --- .env.example.complete | 4 ++-- readme.md | 2 +- resources/views/pages/form.blade.php | 2 +- tests/Uploads/DrawioTest.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.env.example.complete b/.env.example.complete index 39e7b4360..45b1e1321 100644 --- a/.env.example.complete +++ b/.env.example.complete @@ -238,9 +238,9 @@ DISABLE_EXTERNAL_SERVICES=false # Example: AVATAR_URL=https://seccdn.libravatar.org/avatar/${hash}?s=${size}&d=identicon AVATAR_URL= -# Enable draw.io integration +# Enable diagrams.net integration # Can simply be true/false to enable/disable the integration. -# Alternatively, It can be URL to the draw.io instance you want to use. +# Alternatively, It can be URL to the diagrams.net instance you want to use. # For URLs, The following URL parameters should be included: embed=1&proto=json&spin=1 DRAWIO=true diff --git a/readme.md b/readme.md index 0c0626f5b..7c2872a0a 100644 --- a/readme.md +++ b/readme.md @@ -168,6 +168,6 @@ These are the great open-source projects used to help build BookStack: * [Snappy (WKHTML2PDF)](https://github.com/barryvdh/laravel-snappy) * [Laravel IDE helper](https://github.com/barryvdh/laravel-ide-helper) * [WKHTMLtoPDF](http://wkhtmltopdf.org/index.html) -* [Draw.io](https://github.com/jgraph/drawio) +* [diagrams.net](https://github.com/jgraph/drawio) * [Laravel Stats](https://github.com/stefanzweifel/laravel-stats) * [OneLogin's SAML PHP Toolkit](https://github.com/onelogin/php-saml) \ No newline at end of file diff --git a/resources/views/pages/form.blade.php b/resources/views/pages/form.blade.php index d153aed99..7e8b2fdd6 100644 --- a/resources/views/pages/form.blade.php +++ b/resources/views/pages/form.blade.php @@ -1,7 +1,7 @@
name === trans('entities.pages_initial_name')) option:page-editor:has-default-title="true" diff --git a/tests/Uploads/DrawioTest.php b/tests/Uploads/DrawioTest.php index f940a0a5d..3fc009c8a 100644 --- a/tests/Uploads/DrawioTest.php +++ b/tests/Uploads/DrawioTest.php @@ -69,7 +69,7 @@ class DrawioTest extends TestCase $editor = $this->getEditor(); $resp = $this->actingAs($editor)->get($page->getUrl('/edit')); - $resp->assertSee('drawio-url="https://www.draw.io/?embed=1&proto=json&spin=1"'); + $resp->assertSee('drawio-url="https://embed.diagrams.net/?embed=1&proto=json&spin=1"'); config()->set('services.drawio', false); $resp = $this->actingAs($editor)->get($page->getUrl('/edit')); From 1097c61d6d8df9f6d859471744aa65f397a76680 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Mon, 28 Sep 2020 21:55:24 +0100 Subject: [PATCH 4/7] Fixed duplicate requests in attachment manager issue Closes #2286 --- resources/views/attachments/manager-edit-form.blade.php | 1 + resources/views/attachments/manager-link-form.blade.php | 1 + resources/views/attachments/manager.blade.php | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/attachments/manager-edit-form.blade.php b/resources/views/attachments/manager-edit-form.blade.php index f3f11a0fc..ee86dc240 100644 --- a/resources/views/attachments/manager-edit-form.blade.php +++ b/resources/views/attachments/manager-edit-form.blade.php @@ -1,6 +1,7 @@
{{ trans('entities.attachments_edit_file') }}
diff --git a/resources/views/attachments/manager-link-form.blade.php b/resources/views/attachments/manager-link-form.blade.php index 6f22abb32..b51daa40e 100644 --- a/resources/views/attachments/manager-link-form.blade.php +++ b/resources/views/attachments/manager-link-form.blade.php @@ -4,6 +4,7 @@

{{ trans('entities.attachments_explain_link') }}

diff --git a/resources/views/attachments/manager.blade.php b/resources/views/attachments/manager.blade.php index 4bfa97608..4628f7495 100644 --- a/resources/views/attachments/manager.blade.php +++ b/resources/views/attachments/manager.blade.php @@ -24,14 +24,14 @@ 'successMessage' => trans('entities.attachments_file_uploaded'), ])
-
-