add gen_link_id() function to selectively encode/decode the message-id component of /display/ links for message-ids that contain troublesome characters
This commit is contained in:
@@ -3124,6 +3124,12 @@ function cleanup_bbcode($body) {
|
||||
|
||||
}
|
||||
|
||||
function gen_link_id($mid) {
|
||||
if(strpbrk($mid,':/&?<>"\'') !== false)
|
||||
return 'b64.' . base64url_encode($mid);
|
||||
return $mid;
|
||||
}
|
||||
|
||||
// callback for array_walk
|
||||
|
||||
function array_trim(&$v,$k) {
|
||||
@@ -3132,4 +3138,5 @@ function array_trim(&$v,$k) {
|
||||
|
||||
function array_escape_tags(&$v,$k) {
|
||||
$v = escape_tags($v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user