// check against max upload size within Friendica instance
$maximagesize = Config::get('system', 'maximagesize');
if ($maximagesize && ($filesize > $maximagesize)) {
- $formattedBytes = formatBytes($maximagesize);
+ $formattedBytes = Strings::formatBytes($maximagesize);
throw new InternalServerErrorException("image size exceeds Friendica config setting (uploaded size: $formattedBytes)");
}
notice(L10n::t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
break;
case UPLOAD_ERR_FORM_SIZE:
- notice(L10n::t('Image exceeds size limit of %s', formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL);
+ notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL);
break;
case UPLOAD_ERR_PARTIAL:
notice(L10n::t('Image upload didn\'t complete, please try again') . EOL);
$maximagesize = Config::get('system', 'maximagesize');
if ($maximagesize && ($filesize > $maximagesize)) {
- notice(L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
+ notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
@unlink($src);
$foo = 0;
Addon::callHooks('photo_post_end', $foo);
use Friendica\Model\Profile;
use Friendica\Object\Image;
use Friendica\Util\Security;
+use Friendica\Util\Strings;
function profile_photo_init(App $a)
{
$maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) {
- notice(L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
+ notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
@unlink($src);
return;
}
use Friendica\Model\Contact;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Mimetype;
+use Friendica\Util\Strings;
function wall_attach_post(App $a) {
}
if ($maxfilesize && $filesize > $maxfilesize) {
- $msg = L10n::t('File exceeds size limit of %s', formatBytes($maxfilesize));
+ $msg = L10n::t('File exceeds size limit of %s', Strings::formatBytes($maxfilesize));
if ($r_json) {
echo json_encode(['error' => $msg]);
} else {
$maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) {
- $msg = L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize));
+ $msg = L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize));
if ($r_json) {
echo json_encode(['error' => $msg]);
} else {