]> git.mxchange.org Git - friendica.git/blobdiff - mod/photos.php
Remove unused first parameter from BaseProfile::getTabsHTML
[friendica.git] / mod / photos.php
index 9624982ca9076a41b0c6c3f7a56e459fb54ea09e..8bcd9f460cd83acf750ada2e897768002d2f26e6 100644 (file)
@@ -656,10 +656,6 @@ function photos_post(App $a)
 
        $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
 
-       if ($maximagesize == 0) {
-               $maximagesize = INF;
-       }
-
        if ($maximagesize && ($filesize > $maximagesize)) {
                DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));
                @unlink($src);
@@ -869,9 +865,8 @@ function photos_content(App $a)
                $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
        }
 
-       if ($user['hidewall'] && (DI::userSession()->getLocalUserId() != $owner_uid) && !$remote_contact) {
-               DI::sysmsg()->addNotice(DI::l10n()->t('Access to this item is restricted.'));
-               return;
+       if ($user['hidewall'] && !DI::userSession()->isAuthenticated()) {
+               DI::baseUrl()->redirect('profile/' . $user['nickname'] . '/restricted');
        }
 
        $sql_extra = Security::getPermissionsSQLByUserId($owner_uid);
@@ -880,7 +875,7 @@ function photos_content(App $a)
 
        // tabs
        $is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid));
-       $o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']);
+       $o .= BaseProfile::getTabsHTML('photos', $is_owner, $user['nickname'], $profile['hide-friends']);
 
        // Display upload form
        if ($datatype === 'upload') {
@@ -918,7 +913,6 @@ function photos_content(App $a)
                        '$submit' => DI::l10n()->t('Submit'),
                ]);
 
-               $maximagesize_Mbytes = 0;
                // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf
                $mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
                $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize'));
@@ -929,10 +923,10 @@ function photos_content(App $a)
                }
 
                // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit.
-               $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576);
+               $maximagesize_bytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes);
 
                // @todo We may be want to use appropriate binary prefixed dynamicly
-               $usage_message = DI::l10n()->t('The maximum accepted image size is %.6g MB', $maximagesize_Mbytes);
+               $usage_message = DI::l10n()->t('The maximum accepted image size is %s', Strings::formatBytes($maximagesize_bytes));
 
                $tpl = Renderer::getMarkupTemplate('photos_upload.tpl');