mirror of
https://github.com/friendica/friendica
synced 2025-04-25 17:50:11 +00:00
Loglevels are adjusted
This commit is contained in:
parent
312e4d8844
commit
757a5c2de9
32 changed files with 93 additions and 111 deletions
|
@ -498,7 +498,7 @@ class BBCode
|
|||
$c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism', $s, $matches, PREG_SET_ORDER);
|
||||
if ($c) {
|
||||
foreach ($matches as $mtch) {
|
||||
Logger::info('scale_external_image', ['image' => $mtch[1]]);
|
||||
Logger::debug('scale_external_image', ['image' => $mtch[1]]);
|
||||
|
||||
$hostname = str_replace('www.', '', substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3));
|
||||
if (stristr($mtch[1], $hostname)) {
|
||||
|
@ -526,14 +526,14 @@ class BBCode
|
|||
$Image->scaleDown(640);
|
||||
$new_width = $Image->getWidth();
|
||||
$new_height = $Image->getHeight();
|
||||
Logger::info('External images scaled', ['orig_width' => $orig_width, 'new_width' => $new_width, 'orig_height' => $orig_height, 'new_height' => $new_height, 'match' => $mtch[0]]);
|
||||
Logger::debug('External images scaled', ['orig_width' => $orig_width, 'new_width' => $new_width, 'orig_height' => $orig_height, 'new_height' => $new_height, 'match' => $mtch[0]]);
|
||||
$s = str_replace(
|
||||
$mtch[0],
|
||||
'[img=' . $new_width . 'x' . $new_height. ']' . $mtch[1] . '[/img]'
|
||||
. "\n",
|
||||
$s
|
||||
);
|
||||
Logger::info('New string', ['image' => $s]);
|
||||
Logger::debug('New string', ['image' => $s]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ class BBCode
|
|||
|
||||
if (($textlen + $img_start) > $maxlen) {
|
||||
if ($textlen < $maxlen) {
|
||||
Logger::info('the limit happens before an embedded image');
|
||||
Logger::debug('the limit happens before an embedded image');
|
||||
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
|
||||
$textlen = $maxlen;
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ class BBCode
|
|||
|
||||
if (($textlen + $img_end) > $maxlen) {
|
||||
if ($textlen < $maxlen) {
|
||||
Logger::info('the limit happens before the end of a non-embedded image');
|
||||
Logger::debug('the limit happens before the end of a non-embedded image');
|
||||
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
|
||||
$textlen = $maxlen;
|
||||
}
|
||||
|
@ -620,11 +620,11 @@ class BBCode
|
|||
|
||||
if (($textlen + strlen($orig_body)) > $maxlen) {
|
||||
if ($textlen < $maxlen) {
|
||||
Logger::info('the limit happens after the end of the last image');
|
||||
Logger::debug('the limit happens after the end of the last image');
|
||||
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
|
||||
}
|
||||
} else {
|
||||
Logger::info('the text size with embedded images extracted did not violate the limit');
|
||||
Logger::debug('the text size with embedded images extracted did not violate the limit');
|
||||
$new_body = $new_body . $orig_body;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue