Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3f67dd96
authored
2020-12-07 15:58:20 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
dd
1 parent
8c9e7578
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
com/Notifications/Admin.php
com/Notifications/Admin.php
View file @
3f67dd9
...
...
@@ -539,5 +539,36 @@ function strip_word_html($text, $allowed_tags = '<b><i><sup><sub><em><strong><u>
$text
=
preg_replace
(
'/(?:width\=\"\d*\")\S/mxi'
,
'>'
,
$text
);
$text
=
preg_replace
(
'/(?:width\=\"\d*%\")\S/mxi'
,
'>'
,
$text
);
$chr_map
=
array
(
// Windows codepage 1252
"
\xC2\x82
"
=>
"'"
,
// U+0082⇒U+201A single low-9 quotation mark
"
\xC2\x84
"
=>
'"'
,
// U+0084⇒U+201E double low-9 quotation mark
"
\xC2\x8B
"
=>
"'"
,
// U+008B⇒U+2039 single left-pointing angle quotation mark
"
\xC2\x91
"
=>
"'"
,
// U+0091⇒U+2018 left single quotation mark
"
\xC2\x92
"
=>
"'"
,
// U+0092⇒U+2019 right single quotation mark
"
\xC2\x93
"
=>
'"'
,
// U+0093⇒U+201C left double quotation mark
"
\xC2\x94
"
=>
'"'
,
// U+0094⇒U+201D right double quotation mark
"
\xC2\x9B
"
=>
"'"
,
// U+009B⇒U+203A single right-pointing angle quotation mark
// Regular Unicode // U+0022 quotation mark (")
// U+0027 apostrophe (')
"
\xC2\xAB
"
=>
'"'
,
// U+00AB left-pointing double angle quotation mark
"
\xC2\xBB
"
=>
'"'
,
// U+00BB right-pointing double angle quotation mark
"
\xE2\x80\x98
"
=>
"'"
,
// U+2018 left single quotation mark
"
\xE2\x80\x99
"
=>
"'"
,
// U+2019 right single quotation mark
"
\xE2\x80\x9A
"
=>
"'"
,
// U+201A single low-9 quotation mark
"
\xE2\x80\x9B
"
=>
"'"
,
// U+201B single high-reversed-9 quotation mark
"
\xE2\x80\x9C
"
=>
'"'
,
// U+201C left double quotation mark
"
\xE2\x80\x9D
"
=>
'"'
,
// U+201D right double quotation mark
"
\xE2\x80\x9E
"
=>
'"'
,
// U+201E double low-9 quotation mark
"
\xE2\x80\x9F
"
=>
'"'
,
// U+201F double high-reversed-9 quotation mark
"
\xE2\x80\xB9
"
=>
"'"
,
// U+2039 single left-pointing angle quotation mark
"
\xE2\x80\xBA
"
=>
"'"
,
// U+203A single right-pointing angle quotation mark
);
$chr
=
array_keys
(
$chr_map
);
// but: for efficiency you should
$rpl
=
array_values
(
$chr_map
);
// pre-calculate these two arrays
$text
=
str_replace
(
$chr
,
$rpl
,
html_entity_decode
(
$text
,
ENT_QUOTES
,
"UTF-8"
));
return
$text
;
}
...
...
Please
register
or
sign in
to post a comment