From 618a93057a341ffb93a541c99d4832fc332fb954 Mon Sep 17 00:00:00 2001 From: Nikita Kobzev Date: Fri, 17 May 2024 22:34:37 +0300 Subject: [PATCH 1/2] Update the github actions --- .github/workflows/artifcats.yaml | 8 ++++---- .github/workflows/tests.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/artifcats.yaml b/.github/workflows/artifcats.yaml index 835af59..19d3b60 100644 --- a/.github/workflows/artifcats.yaml +++ b/.github/workflows/artifcats.yaml @@ -51,7 +51,7 @@ jobs: tools: tools_opensslv3_x64 - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: code submodules: true @@ -74,7 +74,7 @@ jobs: mv -Path ${{github.workspace}}\_artifacts\bin -Destination "${{github.workspace}}\_artifacts\PBO Manager" - name: Upload binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: PBOManager-binaries-${{env.pbom_version}}-${{env.pbom_build_number}} path: ${{github.workspace}}\_artifacts\ @@ -86,7 +86,7 @@ jobs: light.exe -ext WixUIExtension -dWixUILicenseRtf=${{github.workspace}}\code\LICENSE.rtf -out ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_installer_version}}.msi ${{github.workspace}}\_artifacts\PBOManager.wixobj - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: PBOManager-installer-${{env.pbom_version}}-${{env.pbom_build_number}} path: ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_installer_version}}.msi @@ -101,7 +101,7 @@ jobs: makeappx.exe pack /d ${{github.workspace}}\_msix\ /p ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_msix_version}}.msix - name: Upload MSIX package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: PBOManager-msix-${{env.pbom_version}}-${{env.pbom_build_number}} path: ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_msix_version}}.msix diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f51be3a..adbb654 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -41,7 +41,7 @@ jobs: dir: ${{github.workspace}} - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: code submodules: true From bddd203a5d000bc728b19c29f8003b1e716ac11b Mon Sep 17 00:00:00 2001 From: Nikita Kobzev Date: Sun, 16 Jun 2024 15:16:55 +0300 Subject: [PATCH 2/2] Continue enhancing string sanitization --- pbom/io/bb/__test__/sanitizedstring_test.cpp | 3 ++- pbom/io/bb/sanitizedstring.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pbom/io/bb/__test__/sanitizedstring_test.cpp b/pbom/io/bb/__test__/sanitizedstring_test.cpp index e382013..6ab5f57 100644 --- a/pbom/io/bb/__test__/sanitizedstring_test.cpp +++ b/pbom/io/bb/__test__/sanitizedstring_test.cpp @@ -43,7 +43,8 @@ namespace pboman3::io::test { SanitizedStringTestParam{"COn", "^COn-\\d{1,4}"}, SanitizedStringTestParam{"COM1", "^COM1-\\d{1,4}"}, SanitizedStringTestParam{"lPt2", "^lPt2-\\d{1,4}"}, - SanitizedStringTestParam{"NUL", "^NUL-\\d{1,4}"} + SanitizedStringTestParam{"NUL", "^NUL-\\d{1,4}"}, + SanitizedStringTestParam{"COM6.{69D2CF90-FC33-4FB7-9A0C-EBB0F0FCB43C}", "COM6-\\d{1,4}.%7b69D2CF90-FC33-4FB7-9A0C-EBB0F0FCB43C%7d"} )); class SanitizedStringLengthTest : public testing::TestWithParam { diff --git a/pbom/io/bb/sanitizedstring.cpp b/pbom/io/bb/sanitizedstring.cpp index 43b8fa6..6faebac 100644 --- a/pbom/io/bb/sanitizedstring.cpp +++ b/pbom/io/bb/sanitizedstring.cpp @@ -16,16 +16,16 @@ namespace pboman3::io { if (qsizetype firstInvalidCharIndex; needsCharacterSanitization(sanitized, &firstInvalidCharIndex)) { sanitized = doCharacterSanitization(sanitized, firstInvalidCharIndex); - } else if (QString keyWord; needsKeywordSanitization(sanitized, &keyWord)) { + } + if (QString keyWord; needsKeywordSanitization(sanitized, &keyWord)) { sanitized = doKeywordSanitization(sanitized, keyWord); - } else if (needsWhitespaceSanitization(sanitized)) { + } + if (needsWhitespaceSanitization(sanitized)) { sanitized = doWhitespaceSanitization(sanitized); } - if (QChar ending; needsEndingSanitization(sanitized, &ending)) { sanitized = doEndingSanitization(sanitized, ending); } - if (needsLengthSanitization(sanitized, maxStringLength)) { //such code should run in the beginning of the pipeline to truncate the text before the other processing //but unescaped binary character sequences make QString to report its length incorrectly