Closed ItsSkynet closed 2 years ago
@ItsSkynet Thanks for pointing this out. Let me know if you would like to open a PR to fix this issue?
i did a little bit of research and it seems that the php constant "FILTER_VALIDATE_URL" is too strict when it comes to validate url with this kind of characteristics.
On php 5.5 it was deemed buggy and in today php versions it's deemed too strict by the community.
Removal of this constant would do no good, but instead it would be best advised to find a way to better sanitize the url before reaching this point. i will try to come up with a way to solve this. in the meantime if anyone has an idea, by all means PR it.
Closed by PR #84
Describe the bug verify_image_url Function is assuming twitter post images with ":orig", ":large" ":medium" or ":small" as invalid images and thus is sending empty image value on the fetch return array.
Generated example:
After commenting line 56 trough line 51 in src/OpenGraph.php it successfully generated the image url on this example:
Expected behavior Url array key should be populated if a twitter post has an image.
System Laravel 8 PHP 7.4
Side note anyone having problems getting metadata from socialmedia please use the following user agent set on this example:
$opg_array = OpenGraph::fetch('URL', true, null, null, 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)');