Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
docker
osticket
Commits
f4eae97a
Commit
f4eae97a
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Default nonsensical charsets to ASCII - thanks in part to M$.
parent
51e2cef4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class.mailfetch.php
+7
-4
7 additions, 4 deletions
include/class.mailfetch.php
with
7 additions
and
4 deletions
include/class.mailfetch.php
+
7
−
4
View file @
f4eae97a
...
...
@@ -194,7 +194,10 @@ class MailFetcher {
}
//Convert text to desired encoding..defaults to utf8
function
mime_encode
(
$text
,
$charset
=
null
,
$enc
=
'utf-8'
)
{
//Thank in part to afterburner
function
mime_encode
(
$text
,
$charset
=
null
,
$enc
=
'utf-8'
)
{
//Thank in part to afterburner
if
(
$charset
&&
in_array
(
trim
(
$charset
),
array
(
'default'
,
'x-user-defined'
)))
$charset
=
'ASCII'
;
if
(
function_exists
(
'iconv'
)
and
(
$charset
or
function_exists
(
'mb_detect_encoding'
)))
{
if
(
$charset
)
...
...
@@ -208,13 +211,13 @@ class MailFetcher {
return
utf8_encode
(
$text
);
}
//Generic decoder - resuting text is utf8 encoded -> mirrors imap_utf8
function
mime_decode
(
$text
)
{
//Generic decoder - resu
l
ting text is utf8 encoded -> mirrors imap_utf8
function
mime_decode
(
$text
,
$enc
=
'utf-8'
)
{
$str
=
''
;
$parts
=
imap_mime_header_decode
(
$text
);
foreach
(
$parts
as
$part
)
$str
.
=
$this
->
mime_encode
(
$part
->
text
,
(
$part
->
charset
==
'default'
?
'ASCII'
:
$part
->
charset
),
'utf-8'
);
$str
.
=
$this
->
mime_encode
(
$part
->
text
,
$part
->
charset
,
$enc
);
return
$str
?
$str
:
imap_utf8
(
$text
);
}
...
...
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