]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix PHP warnings when user avatar crop controls aren'tn touched.
authorMeitar Moscovitz <meitarm@gmail.com>
Tue, 3 Feb 2009 16:34:17 +0000 (03:34 +1100)
committerMeitar Moscovitz <meitarm@gmail.com>
Tue, 3 Feb 2009 16:34:17 +0000 (03:34 +1100)
actions/avatarsettings.php

index 19f53b882850d62e60e74c16b7b398a7c99e620f..3029b06211e21c6aa0fb1e2611b1af00f1cc65c9 100644 (file)
@@ -316,11 +316,6 @@ class AvatarsettingsAction extends AccountSettingsAction
 
         $profile = $user->getProfile();
 
-        $x = $this->arg('avatar_crop_x');
-        $y = $this->arg('avatar_crop_y');
-        $w = $this->arg('avatar_crop_w');
-        $h = $this->arg('avatar_crop_h');
-
         $filedata = $_SESSION['FILEDATA'];
 
         if (!$filedata) {
@@ -328,6 +323,11 @@ class AvatarsettingsAction extends AccountSettingsAction
             return;
         }
 
+        $x = $this->arg('avatar_crop_x');
+        $y = $this->arg('avatar_crop_y');
+        $w = ($this->arg('avatar_crop_w')) ? $this->arg('avatar_crop_w') : $filedata['width'];
+        $h = ($this->arg('avatar_crop_h')) ? $this->arg('avatar_crop_h') : $filedata['height'];
+
         $filepath = common_avatar_path($filedata['filename']);
 
         if (!file_exists($filepath)) {