Comments (6)
The problem is not in detecting the mime type - the problem is the regression in functionality. The previous code would detect the mime type from a base64'd value of the data, whereas the new code uses mime_content_type()
of the URL, which doesn't work because it's a url and not a file location.
I'm not sure why this code was changed, but I see the following options:
- Revert this change OR
- Save the file contents to a temporary file before using mime_content_type()
from vcard.
I have the same issue. mime_content_type()
does not work with urls, just local filenames. If the media contents has been already downloaded why not use that to verify the mime type and do another request just to figure it out? I don't understand this change...
Reverting this change works fine. Hopefully @jeroendesloovere shares his thoughts on this.
from vcard.
for a quick fix change line 218 to $mimetype = 'image/jpeg'; if you are adding a jpg of course.
from vcard.
Why not trying something like this? https://github.com/trippo/ResponsiveFilemanager/blob/master/filemanager/include/mime_type_lib.php
from vcard.
Doing some updates and ran into this exact issue. We store our images on s3 and pass the url to addPhoto($url)
and now we are getting the mime_content_type() error.
Is there a reason for this breaking change other than to reduce the library by 3 lines of code? Debating on forking and rolling back this change, but would prefer to understand why the change was important.
from vcard.
Instead of forking we have just fixed our version at 1.2.2. At this time there's no need for us to upgrade to a newer version as we've been running it in production for over a year and have had no issues.
from vcard.
Related Issues (20)
- returning void value
- addLabel() doesn't add $this->getCharsetString() HOT 3
- Address doesn't support umlauts
- VCard::addMedia() 'Content-Type' validation should be case insensitive HOT 2
- New release for PHP 8.0?
- New release for PHP 8.0? HOT 4
- ...is not commonly downloaded and may be dangerous
- ORG Property
- GEO key HOT 1
- Phone types not recognized in Outlook or iOS
- Preference not working
- Disable line folding / make it optional HOT 3
- Add return type of inherited methods from Iterator in VCardParser HOT 2
- How can add file name ? HOT 1
- Telephone displayed wrong in vcf file
- for android HOT 2
- AddMedia - fails for if to allow_url_fopen is 0 due to mimetype inspection HOT 2
- Vcard adds 'HOME' and 'WORK'
- New tag for master HOT 2
- Role is not displaying in iPhone Devices
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vcard.