FriendsOfFlarum / secure-https

Changes all images using HTTP to HTTPS
https://discuss.flarum.org/d/17771
MIT License
6 stars 7 forks source link

HTTPS replacement doesn't work if bbcode extension is disabled #25

Closed clarkwinkelmann closed 1 year ago

clarkwinkelmann commented 1 year ago

Bug Report

Current Behavior The original http:// link is left completely untouched if Markdown is used while BBcode is disabled.

Steps to Reproduce

  1. Disable proxy feature
  2. Disable bbcode extension
  3. Insert HTTP image using Markdown or AutoImage

Expected Behavior Should be supported.

Environment

Output of "php flarum info", run this in terminal in your Flarum directory.

Possible solution(s) The problem is at

https://github.com/FriendsOfFlarum/secure-https/blob/de4866fb65bb00ba61498a9b446f0f6203595a38/src/ModifyContentHtml.php#L25

When the bbcode extension is disabled, images don't have a title attribute and the regex never matches anything.

dsevillamartin commented 1 year ago

BBCode seems to produce empty title HTML now. I still added the chance for it to be optional, but I don't think it's been an issue for a bit.