From 48776e90d9e50f9285e6261bfce6dd86cbdbb300 Mon Sep 17 00:00:00 2001 From: Henri Larget Date: Thu, 1 Oct 2020 23:01:01 +0200 Subject: [PATCH 1/4] adding trusted_proxies for dev and public opened to everyone by default --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index e61693e..c5df627 100644 --- a/.env +++ b/.env @@ -16,6 +16,6 @@ ###> symfony/framework-bundle ### APP_ENV=dev APP_SECRET=b8d83dc95005e7c416c2c3e4194c14ae -TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 +TRUSTED_PROXIES=0.0.0.0/0 #TRUSTED_HOSTS='^localhost|example\.com$' ###< symfony/framework-bundle ### From c27e4a98c3bdcf9b9a511387eff102f70459ee16 Mon Sep 17 00:00:00 2001 From: Henri Larget Date: Thu, 1 Oct 2020 23:04:10 +0200 Subject: [PATCH 2/4] Revert "adding trusted_proxies for dev and public opened to everyone by default" This reverts commit 48776e90d9e50f9285e6261bfce6dd86cbdbb300. --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index c5df627..e61693e 100644 --- a/.env +++ b/.env @@ -16,6 +16,6 @@ ###> symfony/framework-bundle ### APP_ENV=dev APP_SECRET=b8d83dc95005e7c416c2c3e4194c14ae -TRUSTED_PROXIES=0.0.0.0/0 +TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 #TRUSTED_HOSTS='^localhost|example\.com$' ###< symfony/framework-bundle ### From 8f12377bada534ff660f9a89a47422b1918269bf Mon Sep 17 00:00:00 2001 From: Henri Larget Date: Sat, 17 Oct 2020 14:35:35 +0200 Subject: [PATCH 3/4] fix: setting default to fileName --- assets/js/mixins/changePageTitleMixin.js | 9 +++++---- src/Services/FileLoader/FileLoader.php | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/js/mixins/changePageTitleMixin.js b/assets/js/mixins/changePageTitleMixin.js index c7eb681..436c003 100644 --- a/assets/js/mixins/changePageTitleMixin.js +++ b/assets/js/mixins/changePageTitleMixin.js @@ -1,10 +1,11 @@ export default { - methods : { - changePageTitle(){ + methods: { + changePageTitle() { const titleFromMetadata = this.$store.getters.getCurrentArticle?.file?.metadata?.title; const articleTitle = this.$store.getters.getCurrentArticle?.file?.title; - const title = titleFromMetadata || articleTitle; - document.title = `${ title || this.$t('read.notFoundTitle') } | KIP` + const fileName = this.$store.getters.getCurrentArticle?.file?.name; + const title = titleFromMetadata || articleTitle || fileName; + document.title = `${title || this.$t('read.notFoundTitle')} | KIP` } } } diff --git a/src/Services/FileLoader/FileLoader.php b/src/Services/FileLoader/FileLoader.php index 4031fcd..3c8eda1 100644 --- a/src/Services/FileLoader/FileLoader.php +++ b/src/Services/FileLoader/FileLoader.php @@ -36,6 +36,7 @@ public function loadFileByPath($path): File $file = $this->markdown->parse($file); } + $file->name = $fileInfo->getFilenameWithoutExtension(); $file->webpath = $fileInfo->getRelativePathname(); $file->path = $fileInfo->getPathname(); $file->fileInfo = $fileInfo; From 07d1efa15b05925858f2ea11294dd00817dfcbf9 Mon Sep 17 00:00:00 2001 From: Henri Larget Date: Sat, 17 Oct 2020 14:37:38 +0200 Subject: [PATCH 4/4] fix: quick fix for a not existing file --- src/Services/FileLoader/FileLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/FileLoader/FileLoader.php b/src/Services/FileLoader/FileLoader.php index 3c8eda1..40937b8 100644 --- a/src/Services/FileLoader/FileLoader.php +++ b/src/Services/FileLoader/FileLoader.php @@ -32,11 +32,11 @@ public function loadFileByPath($path): File } elseif (strtolower($fileInfo->getExtension()) === "md") { $file = new MarkdownFile(); $file->fileInfo = $fileInfo; + $file->name = $fileInfo->getFilenameWithoutExtension(); $file->markdownContent = $fileInfo->getContents(); $file = $this->markdown->parse($file); } - $file->name = $fileInfo->getFilenameWithoutExtension(); $file->webpath = $fileInfo->getRelativePathname(); $file->path = $fileInfo->getPathname(); $file->fileInfo = $fileInfo;