1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 14:16:32 +02:00

feat: Allow more image widths by default (#430)

This commit is contained in:
Tim Otten
2024-12-11 11:15:46 -08:00
committed by GitHub
parent 63e631ebd3
commit 00a0748427
7 changed files with 10 additions and 3 deletions

View File

@@ -211,6 +211,7 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends
public function testRemoveLargeCSSWidthAndHeightOnImg()
{
$this->config->set('CSS.MaxImgLength', '1200px');
$this->assertResult(
'<img src="" alt="" style="width:10000000px;height:10000000px;border:1px solid #000;" />',
'<img src="" alt="" style="border:1px solid #000;" />'
@@ -244,6 +245,7 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends
public function testRemoveRelativeCSSWidthAndHeightOnImg()
{
$this->config->set('CSS.MaxImgLength', '1200px');
$this->assertResult(
'<img src="" alt="" style="width:10em;height:10em;border:1px solid #000;" />',
'<img src="" alt="" style="border:1px solid #000;" />'
@@ -252,6 +254,7 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends
public function testRemovePercentCSSWidthAndHeightOnImg()
{
$this->config->set('CSS.MaxImgLength', '1200px');
$this->assertResult(
'<img src="" alt="" style="width:100%;height:100%;border:1px solid #000;" />',
'<img src="" alt="" style="border:1px solid #000;" />'