Plugin Directory

Changeset 3472495


Ignore:
Timestamp:
03/02/2026 09:00:29 AM (5 weeks ago)
Author:
amitcodelord
Message:

Update to version 2.3 from GitHub

Location:
enable-virtual-card-upload-vcardvcf
Files:
8 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • enable-virtual-card-upload-vcardvcf/assets/banner-1544x500.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • enable-virtual-card-upload-vcardvcf/assets/banner-772x250.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • enable-virtual-card-upload-vcardvcf/assets/icon-128x128.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • enable-virtual-card-upload-vcardvcf/assets/icon-256x256.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • enable-virtual-card-upload-vcardvcf/tags/2.3/changelog.txt

    r3165099 r3472495  
    11*** WordPress Enable Virtual Card Upload Changelog ***
     2
     32026.3.2 - version 2.3.1
     4 * Fixed upload compatibility with modern WordPress MIME validation for vcf/vcard files
     5 * Added compatibility with WP 6.9.1
    26
    372023.9.19 - version 2.3.0
  • enable-virtual-card-upload-vcardvcf/tags/2.3/prdb-enable-virtual-card-upload.php

    r3165099 r3472495  
    66Plugin URI: https://prodabo.com
    77Description: Enables upload of virtual card (vcf,vcard) files.
    8 Version: 2.3.0
     8Version: 2.3.1
    99Author: Amit verma
    1010Author URI: https://www.linkedin.com/in/avcodelord/
     
    2222
    2323    /**
     24     * Allowed real MIME values that are commonly reported for vCard files.
     25     *
     26     * @var array
     27     */
     28    private $allowed_real_mimes = array(
     29        'text/vcard',
     30        'text/x-vcard',
     31        'text/plain',
     32        'application/octet-stream',
     33    );
     34
     35    /**
    2436     * Construct the plugin object
    2537     * @since    1.0.0
    2638     */
    2739    public function __construct() {
    28         add_filter('upload_mimes', array( &$this, 'enable_vcard_upload') );
     40        add_filter( 'upload_mimes', array( $this, 'enable_vcard_upload' ), 10, 2 );
     41        add_filter( 'wp_check_filetype_and_ext', array( $this, 'allow_vcard_real_mime' ), 10, 5 );
    2942    } // END public function __construct
    3043
     
    4760     * @since 1.0.0
    4861     */
    49     public function enable_vcard_upload ( $mime_types=array() ){
     62    public function enable_vcard_upload( $mime_types = array(), $user = null ) {
    5063        $mime_types['vcf'] = 'text/vcard';
    5164        $mime_types['vcard'] = 'text/vcard';
    5265        return $mime_types;
     66    }
     67
     68    /**
     69     * Allow vCard uploads when real MIME detection returns acceptable text variants.
     70     *
     71     * @param array       $wp_check_filetype_and_ext Values from wp_check_filetype_and_ext().
     72     * @param string      $file                      Full path to uploaded file.
     73     * @param string      $filename                  User supplied filename.
     74     * @param array       $mimes                     Allowed MIME types.
     75     * @param string|bool $real_mime                 Real MIME from fileinfo.
     76     * @return array
     77     */
     78    public function allow_vcard_real_mime( $wp_check_filetype_and_ext, $file, $filename, $mimes, $real_mime = false ) {
     79        $ext = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
     80
     81        if ( ! in_array( $ext, array( 'vcf', 'vcard' ), true ) ) {
     82            return $wp_check_filetype_and_ext;
     83        }
     84
     85        if ( ! empty( $wp_check_filetype_and_ext['ext'] ) && ! empty( $wp_check_filetype_and_ext['type'] ) ) {
     86            return $wp_check_filetype_and_ext;
     87        }
     88
     89        if ( ! empty( $real_mime ) && ! in_array( strtolower( $real_mime ), $this->allowed_real_mimes, true ) ) {
     90            return $wp_check_filetype_and_ext;
     91        }
     92
     93        $wp_check_filetype_and_ext['ext']  = $ext;
     94        $wp_check_filetype_and_ext['type'] = 'text/vcard';
     95
     96        if ( ! isset( $wp_check_filetype_and_ext['proper_filename'] ) ) {
     97            $wp_check_filetype_and_ext['proper_filename'] = false;
     98        }
     99
     100        return $wp_check_filetype_and_ext;
    53101    }
    54102}
  • enable-virtual-card-upload-vcardvcf/tags/2.3/readme.txt

    r3165301 r3472495  
    33Tags: vcf, vcard, upload
    44Requires at least: 3.7
    5 Tested up to: 6.6.2
    6 Stable tag: 2.3.0
     5Tested up to: 6.9.1
     6Stable tag: 2.3.1
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    3737== Changelog ==
    3838
     39= 2.3.1 =
     40* Fixed upload compatibility with modern WordPress MIME validation for vcf/vcard files.
     41* Added compatibility with WP 6.9.1
     42
    3943= 2.3.0 =
    4044* Added compatibility with WP 6.6.x
  • enable-virtual-card-upload-vcardvcf/trunk/changelog.txt

    r3165099 r3472495  
    11*** WordPress Enable Virtual Card Upload Changelog ***
     2
     32026.3.2 - version 2.3.1
     4 * Fixed upload compatibility with modern WordPress MIME validation for vcf/vcard files
     5 * Added compatibility with WP 6.9.1
    26
    372023.9.19 - version 2.3.0
  • enable-virtual-card-upload-vcardvcf/trunk/prdb-enable-virtual-card-upload.php

    r3165099 r3472495  
    66Plugin URI: https://prodabo.com
    77Description: Enables upload of virtual card (vcf,vcard) files.
    8 Version: 2.3.0
     8Version: 2.3.1
    99Author: Amit verma
    1010Author URI: https://www.linkedin.com/in/avcodelord/
     
    2222
    2323    /**
     24     * Allowed real MIME values that are commonly reported for vCard files.
     25     *
     26     * @var array
     27     */
     28    private $allowed_real_mimes = array(
     29        'text/vcard',
     30        'text/x-vcard',
     31        'text/plain',
     32        'application/octet-stream',
     33    );
     34
     35    /**
    2436     * Construct the plugin object
    2537     * @since    1.0.0
    2638     */
    2739    public function __construct() {
    28         add_filter('upload_mimes', array( &$this, 'enable_vcard_upload') );
     40        add_filter( 'upload_mimes', array( $this, 'enable_vcard_upload' ), 10, 2 );
     41        add_filter( 'wp_check_filetype_and_ext', array( $this, 'allow_vcard_real_mime' ), 10, 5 );
    2942    } // END public function __construct
    3043
     
    4760     * @since 1.0.0
    4861     */
    49     public function enable_vcard_upload ( $mime_types=array() ){
     62    public function enable_vcard_upload( $mime_types = array(), $user = null ) {
    5063        $mime_types['vcf'] = 'text/vcard';
    5164        $mime_types['vcard'] = 'text/vcard';
    5265        return $mime_types;
     66    }
     67
     68    /**
     69     * Allow vCard uploads when real MIME detection returns acceptable text variants.
     70     *
     71     * @param array       $wp_check_filetype_and_ext Values from wp_check_filetype_and_ext().
     72     * @param string      $file                      Full path to uploaded file.
     73     * @param string      $filename                  User supplied filename.
     74     * @param array       $mimes                     Allowed MIME types.
     75     * @param string|bool $real_mime                 Real MIME from fileinfo.
     76     * @return array
     77     */
     78    public function allow_vcard_real_mime( $wp_check_filetype_and_ext, $file, $filename, $mimes, $real_mime = false ) {
     79        $ext = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
     80
     81        if ( ! in_array( $ext, array( 'vcf', 'vcard' ), true ) ) {
     82            return $wp_check_filetype_and_ext;
     83        }
     84
     85        if ( ! empty( $wp_check_filetype_and_ext['ext'] ) && ! empty( $wp_check_filetype_and_ext['type'] ) ) {
     86            return $wp_check_filetype_and_ext;
     87        }
     88
     89        if ( ! empty( $real_mime ) && ! in_array( strtolower( $real_mime ), $this->allowed_real_mimes, true ) ) {
     90            return $wp_check_filetype_and_ext;
     91        }
     92
     93        $wp_check_filetype_and_ext['ext']  = $ext;
     94        $wp_check_filetype_and_ext['type'] = 'text/vcard';
     95
     96        if ( ! isset( $wp_check_filetype_and_ext['proper_filename'] ) ) {
     97            $wp_check_filetype_and_ext['proper_filename'] = false;
     98        }
     99
     100        return $wp_check_filetype_and_ext;
    53101    }
    54102}
  • enable-virtual-card-upload-vcardvcf/trunk/readme.txt

    r3165301 r3472495  
    33Tags: vcf, vcard, upload
    44Requires at least: 3.7
    5 Tested up to: 6.6.2
    6 Stable tag: 2.3.0
     5Tested up to: 6.9.1
     6Stable tag: 2.3.1
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    3737== Changelog ==
    3838
     39= 2.3.1 =
     40* Fixed upload compatibility with modern WordPress MIME validation for vcf/vcard files.
     41* Added compatibility with WP 6.9.1
     42
    3943= 2.3.0 =
    4044* Added compatibility with WP 6.6.x
Note: See TracChangeset for help on using the changeset viewer.