Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
56f26d4b
Unverified
Commit
56f26d4b
authored
Dec 19, 2017
by
Scott
Committed by
GitHub
Dec 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #576 from ProThoughts/patch-12
Updated htmLawed to v1.2.4.1 - 12 September 2017.
parents
caa886f1
27ae2930
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
htmLawed.php
qa-include/vendor/htmLawed.php
+7
-7
No files found.
qa-include/vendor/htmLawed.php
View file @
56f26d4b
<?php
<?php
/*
/*
htmLawed 1.2.4
, 31 August
2017
htmLawed 1.2.4
.1, 12 September
2017
Copyright Santosh Patnaik
Copyright Santosh Patnaik
Dual licensed with LGPL 3 and GPL 2+
Dual licensed with LGPL 3 and GPL 2+
A PHP Labware internal utility - www.bioinformatics.org/phplabware/internal_utilities/htmLawed
A PHP Labware internal utility - www.bioinformatics.org/phplabware/internal_utilities/htmLawed
...
@@ -387,10 +387,10 @@ return $r;
...
@@ -387,10 +387,10 @@ return $r;
function
hl_spec
(
$t
){
function
hl_spec
(
$t
){
// final $spec
// final $spec
$s
=
array
();
$s
=
array
();
function
hl_aux1
(
$m
){
if
(
!
function_exists
(
'hl_aux1'
)){
function
hl_aux1
(
$m
){
return
substr
(
str_replace
(
array
(
";"
,
"|"
,
"~"
,
" "
,
","
,
"/"
,
"("
,
")"
,
'`"'
),
array
(
"
\x01
"
,
"
\x02
"
,
"
\x03
"
,
"
\x04
"
,
"
\x05
"
,
"
\x06
"
,
"
\x07
"
,
"
\x08
"
,
'"'
),
$m
[
0
]),
1
,
-
1
);
return
substr
(
str_replace
(
array
(
";"
,
"|"
,
"~"
,
" "
,
","
,
"/"
,
"("
,
")"
,
'`"'
),
array
(
"
\x01
"
,
"
\x02
"
,
"
\x03
"
,
"
\x04
"
,
"
\x05
"
,
"
\x06
"
,
"
\x07
"
,
"
\x08
"
,
'"'
),
$m
[
0
]),
1
,
-
1
);
}
}
}
$t
=
str_replace
(
array
(
"
\t
"
,
"
\r
"
,
"
\n
"
,
' '
),
''
,
preg_replace_callback
(
'/"(?>(`.|[^"])*)"/sm'
,
'hl_aux1'
,
trim
(
$t
)));
$t
=
str_replace
(
array
(
"
\t
"
,
"
\r
"
,
"
\n
"
,
' '
),
''
,
preg_replace_callback
(
'/"(?>(`.|[^"])*)"/sm'
,
'hl_aux1'
,
trim
(
$t
)));
for
(
$i
=
count
((
$t
=
explode
(
';'
,
$t
)));
--
$i
>=
0
;){
for
(
$i
=
count
((
$t
=
explode
(
';'
,
$t
)));
--
$i
>=
0
;){
$w
=
$t
[
$i
];
$w
=
$t
[
$i
];
if
(
empty
(
$w
)
or
(
$e
=
strpos
(
$w
,
'='
))
===
false
or
!
strlen
((
$a
=
substr
(
$w
,
$e
+
1
)))){
continue
;}
if
(
empty
(
$w
)
or
(
$e
=
strpos
(
$w
,
'='
))
===
false
or
!
strlen
((
$a
=
substr
(
$w
,
$e
+
1
)))){
continue
;}
...
@@ -669,9 +669,9 @@ return '';
...
@@ -669,9 +669,9 @@ return '';
function
hl_tidy
(
$t
,
$w
,
$p
){
function
hl_tidy
(
$t
,
$w
,
$p
){
// tidy/compact HTM
// tidy/compact HTM
if
(
strpos
(
' pre,script,textarea'
,
"
$p
,"
)){
return
$t
;}
if
(
strpos
(
' pre,script,textarea'
,
"
$p
,"
)){
return
$t
;}
function
hl_aux2
(
$m
){
if
(
!
function_exists
(
'hl_aux2'
)){
function
hl_aux2
(
$m
){
return
$m
[
1
]
.
str_replace
(
array
(
"<"
,
">"
,
"
\n
"
,
"
\r
"
,
"
\t
"
,
' '
),
array
(
"
\x01
"
,
"
\x02
"
,
"
\x03
"
,
"
\x04
"
,
"
\x05
"
,
"
\x07
"
),
$m
[
3
])
.
$m
[
4
];
return
$m
[
1
]
.
str_replace
(
array
(
"<"
,
">"
,
"
\n
"
,
"
\r
"
,
"
\t
"
,
' '
),
array
(
"
\x01
"
,
"
\x02
"
,
"
\x03
"
,
"
\x04
"
,
"
\x05
"
,
"
\x07
"
),
$m
[
3
])
.
$m
[
4
];
}
}
}
$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
));
$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
));
if
((
$w
=
strtolower
(
$w
))
==
-
1
){
if
((
$w
=
strtolower
(
$w
))
==
-
1
){
return
str_replace
(
array
(
"
\x01
"
,
"
\x02
"
,
"
\x03
"
,
"
\x04
"
,
"
\x05
"
,
"
\x07
"
),
array
(
'<'
,
'>'
,
"
\n
"
,
"
\r
"
,
"
\t
"
,
' '
),
$t
);
return
str_replace
(
array
(
"
\x01
"
,
"
\x02
"
,
"
\x03
"
,
"
\x04
"
,
"
\x05
"
,
"
\x07
"
),
array
(
'<'
,
'>'
,
"
\n
"
,
"
\r
"
,
"
\t
"
,
' '
),
$t
);
...
@@ -725,5 +725,5 @@ return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array(
...
@@ -725,5 +725,5 @@ return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array(
function
hl_version
(){
function
hl_version
(){
// version
// version
return
'1.2.4'
;
return
'1.2.4
.1
'
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment