PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 All 69 releases
← All changes | app/Services/AvatarUploder.php +6 -7 1.10.2 → 2.4.5 View file →
@@ -9,11 +9,11 @@
9 9
10 10 class AvatarUploder
11 11 {
12 12 /**
13 - * @param $file - file object
14 - * @param int $userid - user id
15 - * @param string $type - Customer or Agent
13 + * @param array $file
14 + * @param int $userid Person id
15 + * @param string $type 'customer' or 'agent'
16 16 * @throws Exception
17 17 * @return array
18 18 */
19 19 public function addOrUpdateProfileImage ( $file, $userid, $type )
@@ -25,9 +25,9 @@
25 25 $uploadedImage = FileSystem::setSubDir(strtolower($type).'_avatars')->put($file);
26 26
27 27
28 28 if ( !$uploadedImage ) {
29 - throw new Exception('Something went wrong while updating the profile picture', 403);
29 + throw new Exception(esc_html__('Something went wrong while updating the profile picture', 'fluent-support'), 403);
30 30 }
31 31
32 32 $user->avatar = $uploadedImage[0]['url'];
33 33 $user->save();
@@ -39,10 +39,9 @@
39 39 ];
40 40 }
41 41
42 42 /**
43 - * This Method Will Validate The Extension Of The File
44 - * @param $file - file object
43 + * @param array $file
45 44 * @throws Exception
46 45 * @return bool
47 46 */
48 47 private function validateExtension($file)
@@ -47,9 +46,9 @@
47 46 */
48 47 private function validateExtension($file)
49 48 {
50 49 /**
51 - * Filter profile picture upload types
50 + * Filter allowed profile picture extensions.
52 51 * @param array $allowedExtension
53 52 */
54 53 $allowedExtension = apply_filters('fluent_support/allowed_customer_profile_picture_file_type',
55 54 array('jpeg', 'jpe', 'jpg', 'png'));