Skip to content

Commit 7362c04

Browse files
authored
Merge pull request #5 from fossar/update-1.2.4.2
Update to upstream 1.2.4.2
2 parents c0c8d31 + 89c6433 commit 7362c04

File tree

3 files changed

+156
-152
lines changed

3 files changed

+156
-152
lines changed

htmLawed.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
htmLawed 1.2.4.1, 12 September 2017
4+
htmLawed 1.2.4.2, 16 May 2019
55
Copyright Santosh Patnaik
66
Dual licensed with LGPL 3 and GPL 2+
77
A PHP Labware internal utility - www.bioinformatics.org/phplabware/internal_utilities/htmLawed
@@ -43,7 +43,7 @@ function htmLawed($t, $C=1, $S=array()){
4343
// config URLs
4444
$x = (isset($C['schemes'][2]) && strpos($C['schemes'], ':')) ? strtolower($C['schemes']) : 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, tel, telnet'. (empty($C['safe']) ? ', app, javascript; *: data, javascript, ' : '; *:'). 'file, http, https';
4545
$C['schemes'] = array();
46-
foreach(explode(';', str_replace(array(' ', "\t", "\r", "\n"), '', $x)) as $v){
46+
foreach(explode(';', trim(str_replace(array(' ', "\t", "\r", "\n"), '', $x), ';')) as $v){
4747
$x = $x2 = null; list($x, $x2) = explode(':', $v, 2);
4848
if($x2){$C['schemes'][$x] = array_flip(explode(',', $x2));}
4949
}
@@ -143,7 +143,7 @@ function hl_attrval($a, $t, $p){
143143
}
144144
if($o){$r[] = $tv;}
145145
}
146-
if($s == ','){$s = ', ';}
146+
if($s == ','){$s = ', ';}
147147
$r = implode($s, $r);
148148
return (isset($r[0]) ? $r : (isset($p['default']) ? $p['default'] : 0));
149149
}
@@ -219,7 +219,7 @@ function hl_bal($t, $do=1, $in='div'){
219219
if(isset($cE[$e]) or !in_array($e, $q)){continue;} // Empty/unopen
220220
if($p == $e){array_pop($q); echo '</', $e, '>'; unset($e); continue;} // Last open
221221
$add = ''; // Nesting - close open tags that need to be
222-
for($j=-1, $cj=count($q); ++$j<$cj;){
222+
for($j=-1, $cj=count($q); ++$j<$cj;){
223223
if(($d = array_pop($q)) == $e){break;}
224224
else{$add .= "</{$d}>";}
225225
}
@@ -390,7 +390,7 @@ function hl_spec($t){
390390
if(!function_exists('hl_aux1')){function hl_aux1($m){
391391
return substr(str_replace(array(";", "|", "~", " ", ",", "/", "(", ")", '`"'), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", '"'), $m[0]), 1, -1);
392392
}}
393-
$t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace_callback('/"(?>(`.|[^"])*)"/sm', 'hl_aux1', trim($t)));
393+
$t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace_callback('/"(?>(`.|[^"])*)"/sm', 'hl_aux1', trim($t)));
394394
for($i = count(($t = explode(';', $t))); --$i>=0;){
395395
$w = $t[$i];
396396
if(empty($w) or ($e = strpos($w, '=')) === false or !strlen(($a = substr($w, $e+1)))){continue;}
@@ -698,7 +698,7 @@ function hl_tidy($t, $w, $p){
698698
$r = ''; list($e, $r) = explode('>', $t[$i]);
699699
$x = $e[0] == '/' ? 0 : (substr($e, -1) == '/' ? 1 : ($e[0] != '!' ? 2 : -1));
700700
$y = !$x ? ltrim($e, '/') : ($x > 0 ? substr($e, 0, strcspn($e, ' ')) : 0);
701-
$e = "<$e>";
701+
$e = "<$e>";
702702
if(isset($d[$y])){
703703
if(!$x){
704704
if($n){echo "\n", str_repeat($s, --$n), "$e\n", str_repeat($s, $n);}
@@ -728,5 +728,5 @@ function hl_tidy($t, $w, $p){
728728

729729
function hl_version(){
730730
// version
731-
return '1.2.4.1';
731+
return '1.2.4.2';
732732
}

htmLawed_README.htm

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,40 @@
77
<meta name="keywords" content="htmLawed, HTM, HTML, HTML5, HTML 5, XHTML, XHTML5, HTML Tidy, converter, filter, formatter, purifier, sanitizer, XSS, input, PHP, software, code, script, security, cross-site scripting, hack, sanitize, remove, standards, tags, attributes, elements, Aria, Ruby, data attributes, tidy, indent, auto-indent, prettify, pretty print, htmLawed_README.txt, rTxt2htm, PHP Labware" />
88
<style type="text/css" media="all">
99
<!--/*--><![CDATA[/*><!--*/
10-
a {text-decoration:none; color: blue;}
11-
a:hover {color: red;}
12-
a:visited {color: blue;}
13-
body {margin: 0; padding: 0;}
14-
body, div, html, p {font-family: Georgia, 'Times new roman', Times;}
15-
code.code {font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
16-
div.comment {padding: 5px; color: #999999; font-size: 80%;}
17-
div.comment a {color: #6699cc;}
18-
div#body {width: 70%; margin: 5px; padding: 5px;} /* holds non-toc content */
19-
div#toc {position: fixed; top: 5px; left: 73%; z-index: 2; margin-top: 5px; margin-left: 5px; border: 1px solid gray; padding: 5px; background-color: #ededed; width: 23%; overflow: auto; max-height:94%; font-size: 90%;} /* holds content table (toc) */
20-
div#top {font-size: 14px; margin: 5px; padding: 5px;} /* holds all content */
21-
div.monospace {overflow: auto; font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
22-
div.sub-section {padding-left: 15px;}
23-
div.sub-sub-section {padding-left: 30px;}
24-
h1 {font-size: 22px; margin-top: 5px; margin-bottom: 5px;}
25-
h2 {font-size: 20px; float: left; margin-top: 15px; margin-bottom: 5px;}
26-
h3 {font-size: 18px; float: left; margin-top: 15px; margin-bottom: 5px;}
27-
h4 {font-size: 16px; float: left; margin-top: 15px; margin-bottom: 5px;}
28-
hr {margin-top: 15px; margin-bottom: 5px;}
29-
input, textarea {font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
30-
p.subtle {color: gray; padding: 0; padding-top: 10px; margin: 0;}
31-
p.subtle a, p.subtle a:visited {color: #6699cc;}
32-
span.item-no {color: black;}
33-
span.subtle {color: gray; margin: 0; padding:0;}
34-
span.subtle a, span.subtle a:visited {color: #6699cc;}
35-
span.term {font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
36-
span.toc-item {color: black;}
37-
span.totop {float: right; margin-top: 15px; margin-bottom: 5px;}
38-
span.totop a, span.totop a:visited {color: #6699cc;}
39-
@media screen { /* fixes for old IE */
40-
* html, * html body {overflow-y: auto!important; height: 100%; margin: 0; padding: 0;}
41-
* html div#body {height: 100%; overflow-y: auto; position: relative;}
42-
* html div#toc {position: absolute;}
43-
}
10+
a {text-decoration:none; color: blue;}
11+
a:hover {color: red;}
12+
a:visited {color: blue;}
13+
body {margin: 0; padding: 0;}
14+
body, div, html, p {font-family: Georgia, 'Times new roman', Times;}
15+
code.code {font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
16+
div.comment {padding: 5px; color: #999999; font-size: 80%;}
17+
div.comment a {color: #6699cc;}
18+
div#body {width: 70%; margin: 5px; padding: 5px;} /* holds non-toc content */
19+
div#toc {position: fixed; top: 5px; left: 73%; z-index: 2; margin-top: 5px; margin-left: 5px; border: 1px solid gray; padding: 5px; background-color: #ededed; width: 23%; overflow: auto; max-height:94%; font-size: 90%;} /* holds content table (toc) */
20+
div#top {font-size: 14px; margin: 5px; padding: 5px;} /* holds all content */
21+
div.monospace {overflow: auto; font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
22+
div.sub-section {padding-left: 15px;}
23+
div.sub-sub-section {padding-left: 30px;}
24+
h1 {font-size: 22px; margin-top: 5px; margin-bottom: 5px;}
25+
h2 {font-size: 20px; float: left; margin-top: 15px; margin-bottom: 5px;}
26+
h3 {font-size: 18px; float: left; margin-top: 15px; margin-bottom: 5px;}
27+
h4 {font-size: 16px; float: left; margin-top: 15px; margin-bottom: 5px;}
28+
hr {margin-top: 15px; margin-bottom: 5px;}
29+
input, textarea {font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
30+
p.subtle {color: gray; padding: 0; padding-top: 10px; margin: 0;}
31+
p.subtle a, p.subtle a:visited {color: #6699cc;}
32+
span.item-no {color: black;}
33+
span.subtle {color: gray; margin: 0; padding:0;}
34+
span.subtle a, span.subtle a:visited {color: #6699cc;}
35+
span.term {font-family: 'Bitstream vera sans mono', 'Courier New', 'Courier', monospace;}
36+
span.toc-item {color: black;}
37+
span.totop {float: right; margin-top: 15px; margin-bottom: 5px;}
38+
span.totop a, span.totop a:visited {color: #6699cc;}
39+
@media screen { /* fixes for old IE */
40+
* html, * html body {overflow-y: auto!important; height: 100%; margin: 0; padding: 0;}
41+
* html div#body {height: 100%; overflow-y: auto; position: relative;}
42+
* html div#toc {position: absolute;}
43+
}
4444
/*]]>*/-->
4545
</style>
4646
<title>htmLawed documentation | htmLawed PHP software is a free, open-source, customizable HTML input purifier and filter</title>
@@ -111,8 +111,8 @@ <h1><a id="peak" name="peak"></a>htmLawed documentation</h1>
111111

112112
<div id="body">
113113
<br />
114-
<div class="comment">htmLawed_README.txt, 12 September 2017<br />
115-
htmLawed 1.2.4.1, 12 September 2017<br />
114+
<div class="comment">htmLawed_README.txt, 16 May 2019<br />
115+
htmLawed 1.2.4.2, 16 May 2019<br />
116116
Copyright Santosh Patnaik<br />
117117
Dual licensed with LGPL 3 and GPL 2+<br />
118118
A PHP Labware internal utility &#45; <a href="http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed">http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed</a>&#160;</div>
@@ -1670,7 +1670,7 @@ <h1><a id="peak" name="peak"></a>htmLawed documentation</h1>
16701670
<code class="code">&#160; &#160; &#160; if($element == &#39;object&#39;){</code>
16711671
<br />
16721672

1673-
<code class="code">&#160; &#160; &#160; &#160; $new_element = &#39;&lt;param id=&#39;my_&#39;. $id; allowscriptaccess="never" /&gt;&#39;;</code>
1673+
<code class="code">&#160; &#160; &#160; &#160; $new_element = &#39;&lt;param id="my_&#39;. $id. &#39;"; allowscriptaccess="never" /&gt;&#39;;</code>
16741674
<br />
16751675

16761676
<code class="code">&#160; &#160; &#160; &#160; ++$id;</code>
@@ -1827,6 +1827,8 @@ <h1><a id="peak" name="peak"></a>htmLawed documentation</h1>
18271827
<br />
18281828
&#160; <em>Version number - Release date. Notes</em><br />
18291829
<br />
1830+
&#160; 1.2.4.2 - 16 May 2019. Corrects a PHP notice if a semi-colon is present in <span class="term">$config["schemes"]</span><br />
1831+
<br />
18301832
&#160; 1.2.4.1 - 12 September 2017. Corrects a function re-declaration bug introduced in version 1.2.4<br />
18311833
<br />
18321834
&#160; 1.2.4 - 31 August 2017. Removes use of PHP <span class="term">create_function</span>&#160;function and <span class="term">$php_errormsg</span>&#160;reserved variable (deprecated in PHP 7.2)<br />
@@ -2278,8 +2280,8 @@ <h1><a id="peak" name="peak"></a>htmLawed documentation</h1>
22782280
</div>
22792281
</div>
22802282
<br />
2281-
<hr /><br /><br /><span class="subtle"><small>HTM version of <em><a href="htmLawed_README.txt">htmLawed_README.txt</a></em> generated on 12 Sep, 2017 using <a href="http://www.bioinformatics.org/phplabware/internal_utilities">rTxt2htm</a> from PHP Labware</small></span>
2283+
<hr /><br /><br /><span class="subtle"><small>HTM version of <em><a href="htmLawed_README.txt">htmLawed_README.txt</a></em> generated on 16 May, 2019 using <a href="http://www.bioinformatics.org/phplabware/internal_utilities">rTxt2htm</a> from PHP Labware</small></span>
22822284
</div><!-- ended div body -->
22832285
</div><!-- ended div top -->
22842286
</body>
2285-
</html>
2287+
</html>

0 commit comments

Comments
 (0)