FriendsOfFlarum / upload

The file upload extension with insane intelligence for your Flarum forum.
https://discuss.flarum.org/d/4154
MIT License
176 stars 96 forks source link

Update Imgur.php #314

Closed halimjr closed 2 years ago

halimjr commented 2 years ago

Removing http/https from image link making imgur image not appearing in the open graph image or twitter image meta tags and returning default image. SEO extension cannot get links started with the relative protocol. I removed preg_replace and it worked on my site. Please make changes to this file if there is no other issue.

clarkwinkelmann commented 2 years ago

I think this change makes sense, however I have never used the Imgur driver so I'm not entirely certain why we did this in the first place.

@luceos it was a while ago but maybe you do remember why that change was made back in 2017 (replacing http:// and https:// with // in all Imgur links)? in e3dcb9ce46e0fb01264f526f74d52d2b9c6f392b

From the commit and since there is no other comment, I'm assuming Imgur used to return HTTP links as well, which would break when used on HTTPS? If this is still a possibility, maybe we should use a regex to replace http:// with https:// in all links to ensure compatibility with all websites?

luceos commented 2 years ago

It was a minor optimization as both protocols were served. Serving https by default makes sense now.

I can't seem to approve otherwise I would.