Issue 8254: Some more fixes for too long data for columns

2022.09-rc
Michael 2020-03-28 15:14:40 +00:00
rodzic 66fe39f175
commit 3761e9ee51
2 zmienionych plików z 17 dodań i 1 usunięć

Wyświetl plik

@ -260,6 +260,22 @@ class APContact
// Unhandled from Kroeg
// kroeg:blocks, updated
// When the photo is too large, try to shorten it by removing parts
if (strlen($apcontact['photo']) > 255) {
$parts = parse_url($apcontact['photo']);
unset($parts['query']);
$apcontact['photo'] = Network::unparseURL($parts);
if (strlen($apcontact['photo']) > 255) {
unset($parts['fragment']);
$apcontact['photo'] = Network::unparseURL($parts);
}
if (strlen($apcontact['photo']) > 255) {
$apcontact['photo'] = substr($apcontact['photo'], 0, 255);
}
}
$parts = parse_url($apcontact['url']);
unset($parts['path']);
$baseurl = Network::unparseURL($parts);

Wyświetl plik

@ -345,7 +345,7 @@ class Term
'oid' => $item_id,
'otype' => self::OBJECT_TYPE_POST,
'type' => $type,
'term' => $term,
'term' => substr($term, 0, 255),
'url' => $link,
'guid' => $item['guid'],
'created' => $item['created'],