1

Topic: New version 1.2.9 of htmLawed released on 2 July 2022

New version 1.2.9 of htmLawed released on 2 July 2022:

- improves parsing of $config["deny_attribute"] to permit spaces flanking comma characters and allow references to sets of all ARIA, data-* and event attributes

- fixes parsing of $spec for data-* attribute rules

- now permits use of aria*, data*, and on* in $spec

- now covers all named HTML entities of current standard specification (this increased htmLawed code size by ~40%)

- now recognizes that closing tag may be omitted for 'caption', 'optgroup', 'rp', 'rt', and 'tbody' elements as well

- now recognizes that 'archive' and 'poster' attribute values can have URLs, which can be multiple

- recognizes 'onloadend' as global attribute

- renames some internal functions; improved standards-compliance for element nesting

- package now includes composer.json file

2

Re: New version 1.2.9 of htmLawed released on 2 July 2022

Hello Patnaik,

I just downloaded the newest version - 1.2.9 and when I opened htmLawed.php in VSCode it found 4 errors right away:
Line 425:
      echo '<', $slash, $ele, $attrs, '>';
$slash and $attrs is not defined
Line 1094
        $attrAr[$attr] = '';
$attr is not defined / Undefined variable
Line 1101:
        $attrAr[$attr] =
$attr is not defined / Undefined variable

I also did a search above each of them and was unable to find where those variables were set. Is this intended or or there some sort of trick you got going on in the code to automatically set those variables?

Its been awhile since I used your script, but I and thinking about using it again on a project I'm working on currently since it will be accepting user input.

3

Re: New version 1.2.9 of htmLawed released on 2 July 2022

Hi Yohn, thanks for the feedback. I suspect that VSCode is wrong here. I do not see any PHP warning/notice about undefined objects when using htmLawed with test inputs/scripts. Let me know if you do.

I suspect that code parsing by VSCode is not fully intelligent. E.g., re: line 425 (undefined $slash...), there is an if(isset($ele)) pre-condition, which ensures that $slash is there since both $ele and $slash are set together elsewhere in the code.

4 (edited by gregtoffer 2022-11-04 05:17:13)

Re: New version 1.2.9 of htmLawed released on 2 July 2022

Hello, I updated htmLawed to get rid of a notice on line 51 (I was still using the version 1.2.4.1) but it turns out that the latest version also throw a Notice: Undefined offset: 1 on line 117.
Can you tell me how to fix this?
Thanks!

5

Re: New version 1.2.9 of htmLawed released on 2 July 2022

gregtoffer wrote:

Notice: Undefined offset: 1 on line 117.

Thanks for posting this issue. New htmLawed version 1.2.10 fixes it.

6

Re: New version 1.2.9 of htmLawed released on 2 July 2022

Thanks!