Update appveyor.yml
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
version: 4.0.{build}
|
version: 5.0.{build}
|
||||||
skip_tags: true
|
skip_tags: true
|
||||||
image: Visual Studio 2017
|
image: Visual Studio 2017
|
||||||
environment:
|
environment:
|
||||||
@@ -9,14 +9,13 @@ environment:
|
|||||||
nuget:
|
nuget:
|
||||||
disable_publish_on_pr: true
|
disable_publish_on_pr: true
|
||||||
build_script:
|
build_script:
|
||||||
- ps: (Get-Content src\HtmlSanitizer\HtmlSanitizer.csproj).Replace("1.0.0-VERSION", $env:APPVEYOR_BUILD_VERSION) | Set-Content src\HtmlSanitizer\HtmlSanitizer.csproj
|
|
||||||
- dotnet restore
|
- dotnet restore
|
||||||
- dotnet pack --include-symbols --include-source -c Release src\HtmlSanitizer
|
- dotnet pack --include-symbols --include-source -c Release src\HtmlSanitizer
|
||||||
test_script:
|
test_script:
|
||||||
- ps: |
|
- ps: |
|
||||||
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
||||||
dotnet tool install --global dotnet-sonarscanner
|
dotnet tool install --global dotnet-sonarscanner
|
||||||
dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /d:sonar.organization="mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs"
|
dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /o:"mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs"
|
||||||
dotnet build
|
dotnet build
|
||||||
}
|
}
|
||||||
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\..\coverage.xml" test\HtmlSanitizer.Tests\HtmlSanitizer.Tests.csproj -f netcoreapp2.0
|
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\..\coverage.xml" test\HtmlSanitizer.Tests\HtmlSanitizer.Tests.csproj -f netcoreapp2.0
|
||||||
@@ -24,7 +23,6 @@ test_script:
|
|||||||
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
||||||
dotnet sonarscanner end /d:sonar.login="$env:sonar_token"
|
dotnet sonarscanner end /d:sonar.login="$env:sonar_token"
|
||||||
}
|
}
|
||||||
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
|
|
||||||
- pip install codecov
|
- pip install codecov
|
||||||
- codecov -f "coverage.xml"
|
- codecov -f "coverage.xml"
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|||||||
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>Cleans HTML from constructs that can be used for cross site scripting (XSS)</Description>
|
<Description>Cleans HTML from constructs that can be used for cross site scripting (XSS)</Description>
|
||||||
<Copyright>Copyright 2013-2018 Michael Ganss</Copyright>
|
<Copyright>Copyright 2013-$([System.DateTime]::Now.Year) Michael Ganss</Copyright>
|
||||||
<AssemblyTitle>HtmlSanitizer</AssemblyTitle>
|
<AssemblyTitle>HtmlSanitizer</AssemblyTitle>
|
||||||
<VersionPrefix>1.0.0-VERSION</VersionPrefix>
|
<AppVeyor_Build_Version Condition="'$(APPVEYOR_BUILD_VERSION)' == ''">1.0.0</AppVeyor_Build_Version>
|
||||||
|
<AssemblyVersion>5.0.0.0</AssemblyVersion>
|
||||||
|
<FileVersion>$(AppVeyor_Build_Version).0</FileVersion>
|
||||||
|
<PackageVersion>$(AppVeyor_Build_Version)-beta</PackageVersion>
|
||||||
<Authors>Michael Ganss</Authors>
|
<Authors>Michael Ganss</Authors>
|
||||||
<TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
|
<TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
|
||||||
<AssemblyName>HtmlSanitizer</AssemblyName>
|
<AssemblyName>HtmlSanitizer</AssemblyName>
|
||||||
@@ -14,13 +17,15 @@
|
|||||||
<PackageId>HtmlSanitizer</PackageId>
|
<PackageId>HtmlSanitizer</PackageId>
|
||||||
<PackageTags>xss;anti;antixss;html;security</PackageTags>
|
<PackageTags>xss;anti;antixss;html;security</PackageTags>
|
||||||
<PackageProjectUrl>https://github.com/mganss/HtmlSanitizer</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/mganss/HtmlSanitizer</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://raw.github.com/mganss/HtmlSanitizer/master/LICENSE.md</PackageLicenseUrl>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>git://github.com/mganss/HtmlSanitizer</RepositoryUrl>
|
<RepositoryUrl>git://github.com/mganss/HtmlSanitizer</RepositoryUrl>
|
||||||
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
|
|
||||||
<RootNamespace>Ganss.XSS</RootNamespace>
|
<RootNamespace>Ganss.XSS</RootNamespace>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\HtmlSanitizer.xml</DocumentationFile>
|
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\HtmlSanitizer.xml</DocumentationFile>
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -12,5 +12,3 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: Guid("16af04e9-e712-417e-b749-c8d10148dda9")]
|
[assembly: Guid("16af04e9-e712-417e-b749-c8d10148dda9")]
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.0.0.0")]
|
|
||||||
|
|||||||
@@ -2430,8 +2430,10 @@ rl(javascript:alert(""foo""))'>";
|
|||||||
var allowedStyles = new[] { "margin-top" };
|
var allowedStyles = new[] { "margin-top" };
|
||||||
RemoveReason? actual = null;
|
RemoveReason? actual = null;
|
||||||
|
|
||||||
var s = new HtmlSanitizer(allowedTags: allowedTags, allowedAttributes: allowedAttributes, allowedCssProperties: allowedStyles);
|
var s = new HtmlSanitizer(allowedTags: allowedTags, allowedAttributes: allowedAttributes, allowedCssProperties: allowedStyles)
|
||||||
s.DisallowCssPropertyValue = new Regex(@"\d+.*");
|
{
|
||||||
|
DisallowCssPropertyValue = new Regex(@"\d+.*")
|
||||||
|
};
|
||||||
s.RemovingStyle += (sender, args) =>
|
s.RemovingStyle += (sender, args) =>
|
||||||
{
|
{
|
||||||
actual = args.Reason;
|
actual = args.Reason;
|
||||||
|
|||||||
Reference in New Issue
Block a user