Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
marcus-lodspeakr
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uib-ub
Spesialsamlingene
marcus-lodspeakr
Commits
48e8f208
Commit
48e8f208
authored
8 years ago
by
Øyvind Gjesdal
Browse files
Options
Downloads
Patches
Plain Diff
tatt in space etter elementnavn
parent
98416536
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Haanga/lib/Haanga/Extension/Filter/Decodehtml.php
+5
-4
5 additions, 4 deletions
lib/Haanga/lib/Haanga/Extension/Filter/Decodehtml.php
with
5 additions
and
4 deletions
lib/Haanga/lib/Haanga/Extension/Filter/Decodehtml.php
+
5
−
4
View file @
48e8f208
...
...
@@ -3,12 +3,13 @@
class
Haanga_Extension_Filter_Decodehtml
{
static
function
main
(
$text
)
{
$allowed_tags
=
"<b><i><strong><br><p><ul><ol><li>
<u>
"
;
$allowed_tags_regex
=
preg_replace
(
'/\|$/'
,
''
,
preg_replace
(
'/<([^>]+)>/'
,
'$1|'
,
$allowed_tags
));
$allowed_tags_regex_strip_not_name
=
"/<("
.
$allowed_tags_regex
.
")[^>]+>/"
;
$allowed_tags
=
"<
u><
b><i><strong><br><p><ul><ol><li>"
;
$allowed_tags_regex
=
preg_replace
(
'/\|$/'
,
''
,
preg_replace
(
'/<([^>
^\s
]+)>/'
,
'$1|'
,
$allowed_tags
));
$allowed_tags_regex_strip_not_name
=
"/<("
.
$allowed_tags_regex
.
")
\s+
[^>]+>/"
;
// public $php_alias = "html_entity_decode";
// public $is_safe = TRUE; /* a number if safe */ <b> <b;>, < > ->
return
preg_replace
(
$allowed_tags_regex_strip_not_name
,
'$1'
,
strip_tags
(
html_entity_decode
(
htmlspecialchars
(
html_entity_decode
(
$text
,
ENT_QUOTES
,
"UTF-8"
),
ENT_QUOTES
,
"UTF-8"
),
ENT_QUOTES
,
"UTF-8"
),
$allowed_tags
));
# return $allowed_tags_regex_strip_not_name;
return
preg_replace
(
$allowed_tags_regex_strip_not_name
,
'<$1>'
,
strip_tags
(
html_entity_decode
(
htmlspecialchars
(
html_entity_decode
(
$text
,
ENT_QUOTES
,
"UTF-8"
),
ENT_QUOTES
,
"UTF-8"
),
ENT_QUOTES
,
"UTF-8"
),
$allowed_tags
));
# return htmlspecialchars($allowed_tags_regex);
}}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment