Fixed SSL broken due to bad smilie converting after IPB2.2 import

Black Tiger

Well-known member
I discovered on some topics my SSL is broken. My previous forums were already running with SSL.
Now on some older posts the ssl is broken. When I check the images it seems they are not converted correctly and look like this:
Code:
http://uploads/emoticons/smiley.gif.7fca33fcf6a74faf998a035614f3df3f.gif
so the domain as well as the s in https are missing, causing both the smilie not being displayed and ssl broken.

It did not happen to all of them, but there are a number of posts this happened to.
 
You need to ensure any embedded content is using https not http.

You will have to manually update them.
 
That is the problem. All embedded content was using https. I changed that all and checked manually in the database after changing to https.
But even if it was not https, then the www.mydomain.com is missing which is also odd. Anyway, it's a conversion error.

To prove it to you I checked the backup from my ipb forum which I made before the conversion.
Code:
data-src=\"<___base_url___>/uploads/emoticons/smiley.gif.7fca33fcf6a74faf998a035614f3df3f.gif\"

Everything has that "base_url" statement in front of it, and that was pointing to my full https domain name, otherwise the error would have taken place on all images and smilies, correct?
I do have to correct this manually now, but as far as I can see, this is a conversion hickup.
 
@Brogan Just a question to be sure. On manual change, I don't need that long number correct? And not smiley.gif.2340928340.gif.

Is this the correct way to replace it manually in the database?
Change
Code:
http://uploads/emoticons/smiley.gif.7fca33fcf6a74faf998a035614f3df3f.gif"
to
Code:
https://www.mydomain.com/styles/default/xenforo/smilies/oldstyle/smiley.gif
 
Now I don't understand at all anymore.
I'm searching in the database and even looking for http://uploads/ doesn't even give 1 result?
found them when not using http in front.

They are like this in the table:
Code:
[IMG]http:////uploads/emoticons/smiley.gif.7fca33fcf6a74faf998a035614f3df3f.gif[/IMG]
 
XF doesn't add smilies to posts like that - it literally just uses the smiley code -- :) -- like that.

I don't know how IPB does it but that looks to just be an absolute URL for an image to me.
 
It's in the converted database like this. I just had a look and it seems not only this one but 15784 smilies and there are different ones, not all the same.
So it's like smilie, wink, and lots of others. So for sure this is a conversion bug.

No better way to fix this? Because I can do a search and replace for the absolute url, but that long number, probably is different.
 
It seems the same for the same smilie in different posts.

Only for other smilies it seems different:
Code:
[IMG]http://uploads/emoticons/smiley.gif.7fca33fcf6a74faf998a035614f3df3f.gif[/IMG]
Code:
[IMG]http:////uploads/emoticons/wink.gif.e9e4244b08113414a205af01b3e69291.gif[/IMG]

The very odd thing is that some did convert, but left this old code in place too.
 
should be a simple fix through find and replace through database. i do wonder if one can replace the string using an emoji so that these images are set for life 🤔
 
I wonder that too. I don't even know why IPB just did not save it as for example :) in the database instead of a complete link.

I can do 2 options maybe. Using the search and replace addon.
Second option (to me the easiest) is to download the database, take Editpad Lite or Notepad++ and do some search and replace and after that import the database back in again.
 
do you have phpmyadmin installed on your server? that should do the job easily. but do test by creating a fake entry (change some digits) in a test post and doing a replace for it.

this is what i use to do simple find and replace.

UPDATE xf_post SET message = REPLACE(message, 'ORIGINAL CONTENT', 'REPLACED CONTENT');

DO TAKE A BACKUP OF THE DATABASE if you are doing on your primary database.

I did a random test on my board and emojis do work in sql find and replace.

UPDATE xf_post SET message = REPLACE(message, 'randomtextstring', '😁')

Even this worked fine!

UPDATE xf_post SET message = REPLACE(message, '[IMG]http://uploads/emoticons/smiley.gif.7fca33fcf6a74faf998a035614f3df3f.gif[/IMG]', '😁')
 
Last edited:
Thank you very much.
I've already downloaded the database and replaced several, there are a lot more.
Offline it's easier to find others which start with http:////uploads to change them afterwards.

Before I did that, I indeed did a test to see if the change would work and it did.

But you're awesome providing this kind of help! Thank you very much!
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFI release (1.4.1).

Change log:
Fix inconsistent behavior when parsing image tags and the base URL when importing from IPS.
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom