Skip to content

Commit 56f26d4

Browse files
authored
Merge pull request #576 from ProThoughts/patch-12
Updated htmLawed to v1.2.4.1 - 12 September 2017.
2 parents caa886f + 27ae293 commit 56f26d4

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

qa-include/vendor/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, 31 August 2017
4+
htmLawed 1.2.4.1, 12 September 2017
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
@@ -387,10 +387,10 @@ function hl_regex($p){
387387
function hl_spec($t){
388388
// final $spec
389389
$s = array();
390-
function hl_aux1($m){
390+
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);
392-
}
393-
$t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace_callback('/"(?>(`.|[^"])*)"/sm', 'hl_aux1', trim($t)));
392+
}}
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;}
@@ -669,9 +669,9 @@ function hl_tag2(&$e, &$a, $t=1){
669669
function hl_tidy($t, $w, $p){
670670
// tidy/compact HTM
671671
if(strpos(' pre,script,textarea', "$p,")){return $t;}
672-
function hl_aux2($m){
672+
if(!function_exists('hl_aux2')){function hl_aux2($m){
673673
return $m[1]. str_replace(array("<", ">", "\n", "\r", "\t", ' '), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), $m[3]). $m[4];
674-
}
674+
}}
675675
$t = preg_replace(array('`(<\w[^>]*(?<!/)>)\s+`', '`\s+`', '`(<\w[^>]*(?<!/)>) `'), array(' $1', ' ', '$1'), preg_replace_callback(array('`(<(!\[CDATA\[))(.+?)(\]\]>)`sm', '`(<(!--))(.+?)(-->)`sm', '`(<(pre|script|textarea)[^>]*?>)(.+?)(</\2>)`sm'), 'hl_aux2', $t));
676676
if(($w = strtolower($w)) == -1){
677677
return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array('<', '>', "\n", "\r", "\t", ' '), $t);
@@ -725,5 +725,5 @@ function hl_aux2($m){
725725

726726
function hl_version(){
727727
// version
728-
return '1.2.4';
728+
return '1.2.4.1';
729729
}

0 commit comments

Comments
 (0)