Plugin Directory

Changeset 3205338


Ignore:
Timestamp:
12/10/2024 08:15:46 AM (16 months ago)
Author:
inspireui
Message:

version 4.16.5

Location:
mstore-api
Files:
490 added
4 edited

Legend:

Unmodified
Added
Removed
  • mstore-api/trunk/controllers/flutter-user.php

    r3181851 r3205338  
    10451045        if (isset($params->avatar)) {
    10461046            $count = 1;
    1047             $attachment_id = upload_image_from_mobile($params->avatar, $count, $user_id);
    1048             $url = wp_get_attachment_image_src($attachment_id);
    1049             update_user_meta($user_id, 'user_avatar', $url, '');
     1047            try {
     1048                $attachment_id = upload_image_from_mobile($params->avatar, $count, $user_id);
     1049                $url = wp_get_attachment_image_src($attachment_id);
     1050                update_user_meta($user_id, 'user_avatar', $url, '');
     1051             } catch (Exception $e) {
     1052                return new WP_Error("invalid_avatar", $e->getMessage(), array('status' => 400));
     1053            }
    10501054        }
    10511055
  • mstore-api/trunk/functions/index.php

    r3205228 r3205338  
    810810    $avatar = time() . '_' . $count . '.' . $type_file[1];
    811811
     812    $wp_filetype = wp_check_filetype(basename($avatar), null);
     813    if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
     814        throw new Exception( "The uploaded file is not a valid image. Please try again.");
     815    }
     816
    812817    $uploaddir = wp_upload_dir();
    813818    $myDirPath = $uploaddir["path"];
     
    817822
    818823    $filename = $myDirUrl . '/' . basename($avatar);
    819     $wp_filetype = wp_check_filetype(basename($filename), null);
    820     if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
    821         throw new Exception( "The uploaded file is not a valid image. Please try again.");
    822     }
    823824
    824825    $uploadfile = $uploaddir["path"] . '/' . basename($filename);
  • mstore-api/trunk/mstore-api.php

    r3205228 r3205338  
    44 * Plugin URI: https://github.com/inspireui/mstore-api
    55 * Description: The MStore API Plugin which is used for the FluxBuilder and FluxStore Mobile App
    6  * Version: 4.16.4
     6 * Version: 4.16.5
    77 * Author: FluxBuilder
    88 * Author URI: https://fluxbuilder.com
     
    6060class MstoreCheckOut
    6161{
    62     public $version = '4.16.4';
     62    public $version = '4.16.5';
    6363
    6464    public function __construct()
  • mstore-api/trunk/readme.txt

    r3205228 r3205338  
    44Requires at least: 4.4
    55Tested up to:      6.5.3
    6 Stable tag:        4.16.4
     6Stable tag:        4.16.5
    77License:           GPL-2.0
    88License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51= 4.16.5 =
     52  * Fix to check file type when upload avatar
     53
    5154= 4.16.4 =
    5255  * Fix wholesale price with tax
Note: See TracChangeset for help on using the changeset viewer.