Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
27b50ef5
Commit
27b50ef5
authored
Oct 01, 2005
by
Dries
Browse files
- Revert. Was already committed.
parent
c267c749
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/unicode.inc
View file @
27b50ef5
...
...
@@ -258,31 +258,6 @@ function _mime_header_decode($matches) {
return
$data
;
}
/**
* Complement to mime_header_encode
*/
function
mime_header_decode
(
$header
)
{
// First step: encoded chunks followed by other encoded chunks (need to collapse whitespace)
$header
=
preg_replace_callback
(
'/=\?([^?]+)\?(Q|B)\?([^?]+|\?(?!=))\?=\s+(?==\?)/'
,
'_mime_header_decode'
,
$header
);
// Second step: remaining chunks (do not collapse whitespace)
return
preg_replace_callback
(
'/=\?([^?]+)\?(Q|B)\?([^?]+|\?(?!=))\?=/'
,
'_mime_header_decode'
,
$header
);
}
/**
* Helper function to mime_header_decode
*/
function
_mime_header_decode
(
$matches
)
{
// Regexp groups:
// 1: Character set name
// 2: Escaping method (Q or B)
// 3: Encoded data
$data
=
(
$matches
[
2
]
==
'B'
)
?
base64_decode
(
$matches
[
3
])
:
str_replace
(
'_'
,
' '
,
quoted_printable_decode
(
$matches
[
3
]));
if
(
strtolower
(
$matches
[
1
])
!=
'utf-8'
)
{
$data
=
drupal_convert_to_utf8
(
$data
,
$matches
[
1
]);
}
return
$data
;
}
/**
* Decode all HTML entities (including numerical ones) to regular UTF-8 bytes.
* Double-escaped entities will only be decoded once ("&lt;" becomes "<", not "<").
...
...
Write
Preview
Supports
Markdown
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