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:
Hubzilla
2017-01-19 15:37:30 -08:00
parent 5ce96b9b95
commit 96f196febd
10 changed files with 31 additions and 18 deletions

View File

@@ -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);
}
}