Skip to content

Commit 467e320

Browse files
Fix named parameters normalization issue
Co-authored-by: Constantine Nathanson <constantine@cloudinary.com>
1 parent b21927a commit 467e320

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CloudinaryDotNet.Tests/Transformations/Common/ExpressionTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ public void TestShouldSupportPowOperator()
322322
[TestCase("foo&&bar", "foo&&bar")]
323323
[TestCase("width", "w")]
324324
[TestCase("initial_aspect_ratio", "iar")]
325+
[TestCase("duration", "du")]
326+
[TestCase("preview:duration", "preview:duration")]
325327
[TestCase("$width", "$width")]
326328
[TestCase("$initial_aspect_ratio", "$initial_ar")]
327329
[TestCase("$mywidth", "$mywidth")]

CloudinaryDotNet/Transforms/BaseExpression.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public abstract class BaseExpression<T> : BaseExpression
6969
{ "tags", "tags" },
7070
{ "pageX", "px" },
7171
{ "pageY", "py" },
72+
{ "duration", "du" },
7273
};
7374

7475
/// <summary>
@@ -498,7 +499,7 @@ private static string GetPattern()
498499
}
499500

500501
sb.Remove(sb.Length - 1, 1);
501-
sb.Append(")(?=[ _])|(?<!\\$)(").Append(string.Join("|", parameters.Keys.ToArray())).Append("))");
502+
sb.Append(")(?=[ _])|(?<![\\$:])(").Append(string.Join("|", parameters.Keys.ToArray())).Append("))");
502503
return sb.ToString();
503504
}
504505
}

0 commit comments

Comments
 (0)