Skip to:
Content
Pages
Categories
Search
Top
Bottom

content filter


  • Col_Blimp
    Participant

    @col_blimp

    Looking to filter/replace all instances of <img src="http:// with <img src="https:// is there any hooks that allow this to happen on topic/reply creation and edit?

Viewing 7 replies - 1 through 7 (of 7 total)

  • Pascal Casier
    Moderator

    @casiepa

    Hi @col_blimp,

    Not sure why you want to do this, because it will depend if the site where the picture is, is listening to https or not.

    But if you look for a hook, it might be this one: http://hookr.io/plugins/bbpress/2.5.9/filters/bbp_edit_topic_pre_insert/


    Col_Blimp
    Participant

    @col_blimp

    Hi, you know the sites SSL only and the browser warnings for non SSL images are overkill and off putting so I would rather the site have the green padlock all the time and have the users find a decent image host than show all images but have browser warnings.

    Usually removing the http:// altogether works and the browser will show the green padlock for non SSL images but WordPress doesn’t seem to like it when you do that and wont show any image.


    Robin W
    Moderator

    @robin-w

    WordPress doesn’t seem to like it when you do that and wont show any image.

    wordpress will quite happily show images with no domain name just the directory & file

    eg

    change

    http://www.mysite.com/uploads/2017/march/pic.jpg  
    

    to

    /uploads/2017/march/pic.jpg


    Robin W
    Moderator

    @robin-w

    but if you do want to change it throughout your site use

    Velvet Blues Update URLs

    and change the http to https


    Col_Blimp
    Participant

    @col_blimp

    Hi Robin, you know images from my own site are all SSL so WordPress works in this instance but its with BBPress when the user makes a post and uses the insert image button to link an image from another site that the problems occour ie:



    <img src="https://i.imgur.com/V6sg3f0.png" alt="" />
    <img src="https://i.imgur.com/V6sg3f0.png" alt="" />
    <img src="i.imgur.com/V6sg3f0.png" alt="" />

    but this site here is changing the http to https in all links so the demonstration is a bit of a fail 🙂

    But a non https url will not break a certificate as that only happens if the link is embedding something in the post.


    Robin W
    Moderator

    @robin-w

    ok, so I’m struggling to understand the problem

    if users ppst an http to an http site, then this doesn’t break the cert, so what are they doing that is not working?


    Col_Blimp
    Participant

    @col_blimp

    If you post a hyperlink using the link button then it matters not if it’s http or https as it’s just a reference on the page that does not download anything but if you use the img button then if your site is SSL and the image comes from a source that’s not then the certificate throws warnings.

    I don’t want to change all links to https as that overkill so I’m looking for the best way to just change links using the <img/> tag to https as using this does not work:

    <img src="i.imgur.com/V6sg3f0.png" alt="" />

    but does outside of WordPress ie in MYBB that is how you avoid certificate issues.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar