Skip to content

Commit 2a34ae7

Browse files
committed
Insert transparent gif if img does not have src attribute
Thus it will prevent invalid value to be inserted when trying to fix img tags. Before this change the line: <img alt="Hello world"> led to: <img alt="Hello world" src="src"> Now, the src attribute will be initialized with the value: data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
1 parent 3d43a28 commit 2a34ae7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

htmLawed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ function hl_tag($t)
874874
}
875875

876876
// rqd attr
877-
static $eAR = ['area' => ['alt' => 'area'], 'bdo' => ['dir' => 'ltr'], 'command' => ['label' => ''], 'form' => ['action' => ''], 'img' => ['src' => '', 'alt' => 'image'], 'map' => ['name' => ''], 'optgroup' => ['label' => ''], 'param' => ['name' => ''], 'style' => ['scoped' => ''], 'textarea' => ['rows' => '10', 'cols' => '50']];
877+
static $eAR = ['area' => ['alt' => 'area'], 'bdo' => ['dir' => 'ltr'], 'command' => ['label' => ''], 'form' => ['action' => ''], 'img' => ['src' => 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==', 'alt' => 'image'], 'map' => ['name' => ''], 'optgroup' => ['label' => ''], 'param' => ['name' => ''], 'style' => ['scoped' => ''], 'textarea' => ['rows' => '10', 'cols' => '50']];
878878
if (isset($eAR[$e])) {
879879
foreach ($eAR[$e] as $k => $v) {
880880
if (!isset($a[$k])) {

0 commit comments

Comments
 (0)