fix: the Lottie source is builder-only for users without unfiltered_html (P19)
lottie.innerContent (src → data-lottie-src) makes the frontend load an animation whose expressions lottie-web runs with eval; it joins the S7 gate in ValueCleaner, which covers removals and StoredNodeGuard. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -232,4 +232,25 @@ final class ValueCleanerTest extends TestCase
|
||||
self::assertSame('x', ComposeFixture::cleaner()->clean('divi/text', 'module.decoration.interactionsish', 'x'));
|
||||
self::assertSame('x', ComposeFixture::cleaner()->clean('divi/text', 'module.advanced.interactions', 'x'));
|
||||
}
|
||||
|
||||
/** Ruling P19: the Lottie source (lottie-web runs expressions with eval) is builder-only, at every depth. */
|
||||
public function testLottieSourceNeedsUnfilteredHtml(): void
|
||||
{
|
||||
$value = ['src' => 'https://probe.example/anim.json', 'loop' => 'on'];
|
||||
$paths = ['lottie.innerContent', 'lottie.innerContent.desktop', 'lottie.innerContent.desktop.value.src'];
|
||||
foreach ($paths as $path) {
|
||||
try {
|
||||
ComposeFixture::cleaner()->clean('divi/lottie', $path, $value);
|
||||
self::fail('Accepted for an editor: ' . $path);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
self::assertStringContainsString('nur im Divi-Builder', $e->getMessage());
|
||||
}
|
||||
|
||||
self::assertSame($value, ComposeFixture::cleaner(true)->clean('divi/lottie', $path, $value));
|
||||
}
|
||||
|
||||
// The size of the animation and look-alike paths stay open.
|
||||
self::assertSame('x', ComposeFixture::cleaner()->clean('divi/lottie', 'lottie.advanced.width', 'x'));
|
||||
self::assertSame('x', ComposeFixture::cleaner()->clean('divi/lottie', 'lottie.innerContentish', 'x'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user