Changeset 3472495
- Timestamp:
- 03/02/2026 09:00:29 AM (5 weeks ago)
- Location:
- enable-virtual-card-upload-vcardvcf
- Files:
-
- 8 added
- 10 edited
- 1 copied
-
assets/banner-1544x500.png (modified) (1 prop) (previous)
-
assets/banner-772x250.png (modified) (1 prop) (previous)
-
assets/icon-128x128.png (modified) (1 prop) (previous)
-
assets/icon-256x256.png (modified) (1 prop) (previous)
-
tags/2.3 (copied) (copied from enable-virtual-card-upload-vcardvcf/trunk)
-
tags/2.3/README.md (added)
-
tags/2.3/assets (added)
-
tags/2.3/assets/banner-1544x500.png (added)
-
tags/2.3/assets/icon-256x256.png (added)
-
tags/2.3/changelog.txt (modified) (1 diff)
-
tags/2.3/prdb-enable-virtual-card-upload.php (modified) (3 diffs)
-
tags/2.3/readme.txt (modified) (2 diffs)
-
trunk/README.md (added)
-
trunk/assets (added)
-
trunk/assets/banner-1544x500.png (added)
-
trunk/assets/icon-256x256.png (added)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/prdb-enable-virtual-card-upload.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
enable-virtual-card-upload-vcardvcf/assets/banner-1544x500.png
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property
svn:mime-type
changed from
-
enable-virtual-card-upload-vcardvcf/assets/banner-772x250.png
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property
svn:mime-type
changed from
-
enable-virtual-card-upload-vcardvcf/assets/icon-128x128.png
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property
svn:mime-type
changed from
-
enable-virtual-card-upload-vcardvcf/assets/icon-256x256.png
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property
svn:mime-type
changed from
-
enable-virtual-card-upload-vcardvcf/tags/2.3/changelog.txt
r3165099 r3472495 1 1 *** WordPress Enable Virtual Card Upload Changelog *** 2 3 2026.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 2 6 3 7 2023.9.19 - version 2.3.0 -
enable-virtual-card-upload-vcardvcf/tags/2.3/prdb-enable-virtual-card-upload.php
r3165099 r3472495 6 6 Plugin URI: https://prodabo.com 7 7 Description: Enables upload of virtual card (vcf,vcard) files. 8 Version: 2.3. 08 Version: 2.3.1 9 9 Author: Amit verma 10 10 Author URI: https://www.linkedin.com/in/avcodelord/ … … 22 22 23 23 /** 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 /** 24 36 * Construct the plugin object 25 37 * @since 1.0.0 26 38 */ 27 39 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 ); 29 42 } // END public function __construct 30 43 … … 47 60 * @since 1.0.0 48 61 */ 49 public function enable_vcard_upload ( $mime_types=array() ){62 public function enable_vcard_upload( $mime_types = array(), $user = null ) { 50 63 $mime_types['vcf'] = 'text/vcard'; 51 64 $mime_types['vcard'] = 'text/vcard'; 52 65 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; 53 101 } 54 102 } -
enable-virtual-card-upload-vcardvcf/tags/2.3/readme.txt
r3165301 r3472495 3 3 Tags: vcf, vcard, upload 4 4 Requires at least: 3.7 5 Tested up to: 6. 6.26 Stable tag: 2.3. 05 Tested up to: 6.9.1 6 Stable tag: 2.3.1 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 37 37 == Changelog == 38 38 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 39 43 = 2.3.0 = 40 44 * Added compatibility with WP 6.6.x -
enable-virtual-card-upload-vcardvcf/trunk/changelog.txt
r3165099 r3472495 1 1 *** WordPress Enable Virtual Card Upload Changelog *** 2 3 2026.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 2 6 3 7 2023.9.19 - version 2.3.0 -
enable-virtual-card-upload-vcardvcf/trunk/prdb-enable-virtual-card-upload.php
r3165099 r3472495 6 6 Plugin URI: https://prodabo.com 7 7 Description: Enables upload of virtual card (vcf,vcard) files. 8 Version: 2.3. 08 Version: 2.3.1 9 9 Author: Amit verma 10 10 Author URI: https://www.linkedin.com/in/avcodelord/ … … 22 22 23 23 /** 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 /** 24 36 * Construct the plugin object 25 37 * @since 1.0.0 26 38 */ 27 39 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 ); 29 42 } // END public function __construct 30 43 … … 47 60 * @since 1.0.0 48 61 */ 49 public function enable_vcard_upload ( $mime_types=array() ){62 public function enable_vcard_upload( $mime_types = array(), $user = null ) { 50 63 $mime_types['vcf'] = 'text/vcard'; 51 64 $mime_types['vcard'] = 'text/vcard'; 52 65 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; 53 101 } 54 102 } -
enable-virtual-card-upload-vcardvcf/trunk/readme.txt
r3165301 r3472495 3 3 Tags: vcf, vcard, upload 4 4 Requires at least: 3.7 5 Tested up to: 6. 6.26 Stable tag: 2.3. 05 Tested up to: 6.9.1 6 Stable tag: 2.3.1 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 37 37 == Changelog == 38 38 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 39 43 = 2.3.0 = 40 44 * Added compatibility with WP 6.6.x
Note: See TracChangeset
for help on using the changeset viewer.