Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
cb6e2329
Commit
cb6e2329
authored
Oct 3, 2003
by
Kjartan Mannes
Browse files
Options
Downloads
Patches
Plain Diff
- Re-wrote user_mail_encode().
parent
a33df1de
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/user.module
+11
-23
11 additions, 23 deletions
modules/user.module
modules/user/user.module
+11
-23
11 additions, 23 deletions
modules/user/user.module
with
22 additions
and
46 deletions
modules/user.module
+
11
−
23
View file @
cb6e2329
...
...
@@ -324,33 +324,21 @@ function user_mail($mail, $subject, $message, $header) {
$mail
,
user_mail_encode
(
$subject
),
str_replace
(
"
\r
"
,
""
,
$message
),
"MIME-
v
ersion: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8B
IT
\n
"
.
$header
"MIME-
V
ersion: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8B
it
\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
)
{
...
...
This diff is collapsed.
Click to expand it.
modules/user/user.module
+
11
−
23
View file @
cb6e2329
...
...
@@ -324,33 +324,21 @@ function user_mail($mail, $subject, $message, $header) {
$mail
,
user_mail_encode
(
$subject
),
str_replace
(
"
\r
"
,
""
,
$message
),
"MIME-
v
ersion: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8B
IT
\n
"
.
$header
"MIME-
V
ersion: 1.0
\n
Content-type: text/plain; charset=UTF-8; format=flowed
\n
Content-transfer-encoding: 8B
it
\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
)
{
...
...
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
sign in
to comment