Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/functional_all_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-24.04
container:
image: cypress/included:15.5.0
image: cypress/included:15.6.0
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: ./.github/actions/setup-dotnet
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-24.04
container:
image: cypress/included:15.5.0
image: cypress/included:15.6.0
env:
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-24.04
container:
image: cypress/included:15.5.0
image: cypress/included:15.6.0
services:
postgres:
image: postgres:11
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-24.04
container:
image: cypress/included:15.5.0
image: cypress/included:15.6.0
services:
mysql:
image: mysql:8
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-24.04
container:
image: cypress/included:15.5.0
image: cypress/included:15.6.0
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageVersion Include="Castle.Core" Version="5.2.1" />
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.3.0" />
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.19.12" />
<PackageVersion Include="Fluid.Core" Version="2.30.0" />
<PackageVersion Include="Fluid.Core" Version="2.31.0" />
<PackageVersion Include="GraphQL" Version="8.7.0" />
<PackageVersion Include="GraphQL.DataLoader" Version="8.7.0" />
<PackageVersion Include="GraphQL.MicrosoftDI" Version="8.7.0" />
Expand Down Expand Up @@ -62,8 +62,8 @@
<PackageVersion Include="StackExchange.Redis" Version="2.9.32" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="xunit.v3" Version="3.1.0" />
<PackageVersion Include="xunit.analyzers" Version="1.24.0" />
<PackageVersion Include="xunit.v3" Version="3.2.0" />
<PackageVersion Include="xunit.analyzers" Version="1.25.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="YesSql" Version="5.4.7" />
<PackageVersion Include="YesSql.Abstractions" Version="5.4.7" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using OrchardCore.Shortcodes.Models;
using OrchardCore.Shortcodes.Services;
using OrchardCore.Shortcodes.ViewModels;
using Parlot;
using Shortcodes;

namespace OrchardCore.Shortcodes.Controllers;

Expand Down Expand Up @@ -347,7 +347,16 @@ public async Task<ActionResult> IndexPost(ContentOptions options, IEnumerable<st

private static bool IsValidShortcodeName(string name)
{
var scanner = new Scanner(name);
return scanner.ReadIdentifier(out var result) && name.Length == result.Length;
try
{
var nodes = new ShortcodesParser().Parse($"[{name}]");
return nodes.Count == 1 &&
nodes[0] is Shortcode shortcodeNode &&
shortcodeNode.Identifier.Equals(name, StringComparison.OrdinalIgnoreCase);
}
catch (Exception)
{
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArgument
return FluidValue.Create(missingUsers.Concat(cachedUsers).ToList(), ctx.Options);
}

return NilValue.Empty;
return EmptyValue.Instance;
}

if (input.Type == FluidValues.Array)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,4 @@ public override void WriteTo(TextWriter writer, TextEncoder encoder, CultureInfo
{
_value.WriteTo(writer, (HtmlEncoder)encoder);
}

[Obsolete("GetValue is obsolete, prefer the GetValueAsync method.")]
protected override FluidValue GetValue(string name, TemplateContext context)
{
return NilValue.Instance;
}

protected override FluidValue GetIndex(FluidValue index, TemplateContext context)
{
return NilValue.Instance;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public override ValueTask<FluidValue> GetValueAsync(string name, TemplateContext
return NilValue.Instance;
}

[Obsolete("This method has been deprecated, please use GetIndexAsync() instead.")]
protected override FluidValue GetIndex(FluidValue index, TemplateContext context)
{
var i = (int)index.ToNumberValue();
Expand All @@ -143,6 +144,11 @@ protected override FluidValue GetIndex(FluidValue index, TemplateContext context
return NilValue.Instance;
}

// Using the original method for backward compatibility.
#pragma warning disable CS0618 // Type or member is obsolete
public override ValueTask<FluidValue> GetIndexAsync(FluidValue index, TemplateContext context) => GetIndex(index, context);
#pragma warning restore CS0618 // Type or member is obsolete

public override bool ToBooleanValue()
=> true;

Expand Down