1. Attachments are working again! Check out this thread for more details and to report any other bugs.

proxy.php is breaking images in posts (even old ones that weren't broken when posted)

Discussion in 'PriusChat Website Questions' started by ChapmanF, Apr 30, 2017.

  1. ChapmanF

    ChapmanF Senior Member

    Joined:
    Mar 30, 2008
    23,318
    15,107
    0
    Location:
    Indiana, USA
    Vehicle:
    2010 Prius
    Model:
    IV
    This has been going on for a while (I first remember noticing with images Maine Pilot tried to post in February in the Oh... OOHHHH... OH Shoot thread, but I've just noticed it's also messing up an old post of mine where all the images worked fine back when I posted it, and nothing has changed with any of them, but now four of them show up as missing-image.png because of some way proxy.php is screwing up.

    For example, in one post, Maine Pilot referred to this GIF image:

    Code:
    http://www.bedug.com/pics/Fun3/daily_gifdump_1235_11.gif
    You can paste that URL into your browser's address bar and see there's no problem with the image. But if you look at his post now, instead of the image, you get missing-image.png , and it's because the image URL has been changed to:

    Code:
    https://priuschat.com/proxy.php?image=http%3A%2F%2Fwww.bedug.com%2Fpics%2FFun3%2Fdaily_gifdump_1235_11.gif&hash=c0bab84b9cf7a77c8af670e063f254ad
    You can see the correct original URL is there, just with every colon changed to percent-3A and every slash changed to percent-2F, and sure enough, you can chop off the whole prefix up through image= and the whole suffix starting with ampersand-hash, and turn the percent-3As and percent-2Fs back to colons and slashes, and the image loads just fine.

    It's not delightful to have to do that, though. Can whatever is wrong with proxy.php be fixed (or, if not, as a radical thought, could it just not be used, since it is breaking people's posts which would not be broken without it)?

    -Chap
     
  2. Max Finch

    Max Finch Active Member

    Joined:
    Aug 10, 2017
    135
    130
    0
    Location:
    Medford Oregon
    Vehicle:
    2008 Prius
    Model:
    Touring
    Bump. It's really hard to follow along with DIY's and Mod journals when there's no images.
     
    RCO likes this.
  3. Max Finch

    Max Finch Active Member

    Joined:
    Aug 10, 2017
    135
    130
    0
    Location:
    Medford Oregon
    Vehicle:
    2008 Prius
    Model:
    Touring
    Upon further investigation it seems the PHP is using a urlencode but not a urldecode.

    If you copy the image URL and paste it here: URL Decode and Encode - Online

    then again isolate the true link the image shows up.

    Still not sure why the hash and stuff before the http:// shows up
     
    RCO likes this.
  4. Max Finch

    Max Finch Active Member

    Joined:
    Aug 10, 2017
    135
    130
    0
    Location:
    Medford Oregon
    Vehicle:
    2008 Prius
    Model:
    Touring
    Wrote a little javascript code I'll just bookmark until this is solved.

    here's the link, input the url into the left and it outputs to the right.

    Also opens a popup of the image, the first time you'll need to allow popups.

    Edit fiddle - JSFiddle

    my web coding is rather limited. I'm sure there's a way to input something and then click submit or something but I don't know how to do that.
     
    RCO and SFO like this.
  5. Max Finch

    Max Finch Active Member

    Joined:
    Aug 10, 2017
    135
    130
    0
    Location:
    Medford Oregon
    Vehicle:
    2008 Prius
    Model:
    Touring
    Edited my code a bit.

    Made it simpler for users to browse images. Visit this site: Prius Chat Image

    Paste the link in the box that says "Picture URL Here"

    Click submit and it should automatically open the image in a new tab.


    Hopefully someone with power will fix this issue within the site?
     
    RCO likes this.