]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/avatarsettings.php
Updated styling for OAuth authorization page's desktop mode.
[quix0rs-gnu-social.git] / actions / avatarsettings.php
index cf4525552029f1fde641d6311235991cca3732a5..9d4040e75ab9e675b78e355103fe7a0290afd4fd 100644 (file)
@@ -103,7 +103,7 @@ class AvatarsettingsAction extends AccountSettingsAction
 
         if (!$profile) {
             common_log_db_error($user, 'SELECT', __FILE__);
-            $this->serverError(_('User without matching profile'));
+            $this->serverError(_('User without matching profile.'));
             return;
         }
 
@@ -182,7 +182,7 @@ class AvatarsettingsAction extends AccountSettingsAction
 
         if (!$profile) {
             common_log_db_error($user, 'SELECT', __FILE__);
-            $this->serverError(_('User without matching profile'));
+            $this->serverError(_('User without matching profile.'));
             return;
         }
 
@@ -254,9 +254,11 @@ class AvatarsettingsAction extends AccountSettingsAction
             && empty($_POST)
             && ($_SERVER['CONTENT_LENGTH'] > 0)
         ) {
-            $msg = _('The server was unable to handle that much POST ' .
-                'data (%s bytes) due to its current configuration.');
-
+            // TRANS: Client error displayed when the number of bytes in a POST request exceeds a limit.
+            // TRANS: %s is the number of bytes of the CONTENT_LENGTH.
+            $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+                      'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+                      intval($_SERVER['CONTENT_LENGTH']));
             $this->showForm(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
             return;
         }
@@ -301,6 +303,10 @@ class AvatarsettingsAction extends AccountSettingsAction
             $this->showForm($e->getMessage());
             return;
         }
+        if ($imagefile === null) {
+            $this->showForm(_('No file uploaded.'));
+            return;
+        }
 
         $cur = common_current_user();
 
@@ -416,8 +422,8 @@ class AvatarsettingsAction extends AccountSettingsAction
         parent::showScripts();
 
         if ($this->mode == 'crop') {
-            $this->script('js/jcrop/jquery.Jcrop.min.js');
-            $this->script('js/jcrop/jquery.Jcrop.go.js');
+            $this->script('jcrop/jquery.Jcrop.min.js');
+            $this->script('jcrop/jquery.Jcrop.go.js');
         }
 
         $this->autofocus('avatarfile');