Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
303
Merge Requests
303
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
cb6e2329
Commit
cb6e2329
authored
Oct 03, 2003
by
Kjartan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Re-wrote user_mail_encode().
parent
a33df1de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
46 deletions
+22
-46
modules/user.module
modules/user.module
+11
-23
modules/user/user.module
modules/user/user.module
+11
-23
No files found.
modules/user.module
View file @
cb6e2329
...
...
@@ -324,33 +324,21 @@ function user_mail($mail, $subject, $message, $header) {
$mail
,
user_mail_encode
(
$subject
),
str_replace
(
"
\r
"
,
""
,
$message
),
"MIME-
version: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8BIT
\n
"
.
$header
"MIME-
Version: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8Bit
\n
"
.
$header
);
}
}
// Original code by <gordon at kanazawa-gu dot ac dot jp>
function
user_mail_encode
(
$string
)
{
// define start delimimter, end delimiter and spacer
$end
=
"?="
;
$start
=
"=?UTF-8?B?"
;
$spacer
=
"
{
$end
}
\r\n
{
$start
}
"
;
// determine length of encoded text within
// chunks and ensure length is even
$length
=
75
-
strlen
(
$start
)
-
strlen
(
$end
);
$length
=
floor
(
$length
/
2
)
*
2
;
// encode the string and split it into chunks
// with spacers after each chunk
$string
=
base64_encode
(
$string
);
$string
=
chunk_split
(
$string
,
$length
,
$spacer
);
// remove trailing spacer and add start and end delimiters
$spacer
=
preg_quote
(
$spacer
);
$string
=
preg_replace
(
"/
{
$spacer
}
$/"
,
""
,
$string
);
return
(
$start
.
$string
.
$end
);
function
user_mail_encode
(
$string
,
$charset
=
"UTF-8"
)
{
/*
** Used to encodes mail headers that contain non US- ASCII
** characters.
** http://www.rfc-editor.org/rfc/rfc2047.txt
*/
$maxlen
=
75
-
7
-
strlen
(
$charset
);
$string
=
trim
(
chunk_split
(
base64_encode
(
$string
),
$maxlen
,
"
\n
"
));
$string
=
trim
(
preg_replace
(
'/^(.*)$/m'
,
" =?
$charset
?B?
\\
1?="
,
$string
));
return
$string
;
}
function
user_deny
(
$type
,
$mask
)
{
...
...
modules/user/user.module
View file @
cb6e2329
...
...
@@ -324,33 +324,21 @@ function user_mail($mail, $subject, $message, $header) {
$mail
,
user_mail_encode
(
$subject
),
str_replace
(
"
\r
"
,
""
,
$message
),
"MIME-
version: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8BIT
\n
"
.
$header
"MIME-
Version: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8Bit
\n
"
.
$header
);
}
}
// Original code by <gordon at kanazawa-gu dot ac dot jp>
function
user_mail_encode
(
$string
)
{
// define start delimimter, end delimiter and spacer
$end
=
"?="
;
$start
=
"=?UTF-8?B?"
;
$spacer
=
"
{
$end
}
\r\n
{
$start
}
"
;
// determine length of encoded text within
// chunks and ensure length is even
$length
=
75
-
strlen
(
$start
)
-
strlen
(
$end
);
$length
=
floor
(
$length
/
2
)
*
2
;
// encode the string and split it into chunks
// with spacers after each chunk
$string
=
base64_encode
(
$string
);
$string
=
chunk_split
(
$string
,
$length
,
$spacer
);
// remove trailing spacer and add start and end delimiters
$spacer
=
preg_quote
(
$spacer
);
$string
=
preg_replace
(
"/
{
$spacer
}
$/"
,
""
,
$string
);
return
(
$start
.
$string
.
$end
);
function
user_mail_encode
(
$string
,
$charset
=
"UTF-8"
)
{
/*
** Used to encodes mail headers that contain non US- ASCII
** characters.
** http://www.rfc-editor.org/rfc/rfc2047.txt
*/
$maxlen
=
75
-
7
-
strlen
(
$charset
);
$string
=
trim
(
chunk_split
(
base64_encode
(
$string
),
$maxlen
,
"
\n
"
));
$string
=
trim
(
preg_replace
(
'/^(.*)$/m'
,
" =?
$charset
?B?
\\
1?="
,
$string
));
return
$string
;
}
function
user_deny
(
$type
,
$mask
)
{
...
...
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