Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: postpar on November 27, 2016, 03:54:35 PM

Title: Won’t post linked images... no matter what size/site
Post by: postpar on November 27, 2016, 03:54:35 PM
On dippy.org, I'm finding that I can see images if they are posted as attachments, but not if they are posted as links. You can see the linked images on the New Post or Reply area, but as soon as you click on Post, they disappear! and are not in the code. This is pretty consistent even using, say, a little icon from the same site.

Any thoughts? GD is showing as 2.1 compatible and integrated; the setup is 2.012. The only add-ons are Ad Management and a bunch of updates. I did have Resize Attached Images but that shouldn't affect anything (and I removed it while testing this).

Am I missing something, some setting, somewhere?
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on November 27, 2016, 04:13:55 PM
URL demonstrating the issue?
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 27, 2016, 04:16:21 PM
http://www.dippy.org/forum2/index.php?topic=15666.msg193453#msg193453

I can create a login for you and send it over if you don't want to register.
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on November 27, 2016, 06:02:40 PM
There is a slight other issue with your site...  the smf copyright has been significantly altered.   While this is permissible per the license, when the copyright is removed or altered in such a manner, we typically have chosen to not provide support to such sites...
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 27, 2016, 07:49:27 PM
What would be acceptable? I don't think any of my readers use WAP2 and I highly doubt they even use RSS. Including the XHTML checker seems off. I didn't try to hide it or de-emphasize it, just make it more relevant without assigning the copyright for images and such as well (I used Xenforo's language).

I wasn't aware I'd lose all support by doing this.
Title: Re: Won’t post linked images... no matter what size/site
Post by: Illori on November 27, 2016, 08:32:43 PM
you just need the first line of the copyright as it is on this forum. the xhtml etc is not part of the copyright statement. the only part of that line that may be modified is to remove the version string.
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on November 27, 2016, 09:07:02 PM
SMF 2.0.12 | SMF © 2016, Simple Machines

Like that ....  I understand what ou were trying to do...
On some of my forums, I add a line using the custom copyright mod.

Original media and article content © 2016 ThisSite
Or
Site Contents © 2016 ThisSite

Also, on fan sites, like 40kOnline, I add the following...

Warhammer, 40K & other terms ®, © Games Workshop, Ltd. No infringement of their trademarks is intended.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 28, 2016, 04:24:41 PM
Thanks for the clarification. I did that last night, made sure I had the three different links. Is it acceptable now? It's actually longer and more noticeable than the requirement, I am happy to give credit to SMF. What's good for SMF is good for me!
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on November 28, 2016, 05:52:00 PM
well...   it doesn't quite match the standards...  but for the mean time -- What, exactly are you trying to post on your site in that test thread?

Post it here, in [code] tags, please.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 29, 2016, 09:04:40 AM
Testing (img)http://www.dippy.org/graphic/site/Information.jpg(/img)

with brackets instead of ()

Uploading attachments works.
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on November 29, 2016, 09:32:21 AM
Quote from: allpar on November 29, 2016, 09:04:40 AM
Testing (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.dippy.org%2Fgraphic%2Fsite%2FInformation.jpg&hash=e4e3d77ee4cc3de62ba6b82be7cd0ad23f1ec037)

with brackets instead of ()

Uploading attachments works.

Well, it works here...  which emilimates one possibility...

And that is the only text that you put in that post?

See, the image in the signature block, which also use some img tags, works...  which indicates an issue with your post, either in submission or display.

The next question is...   if you go to edit that post, is the Img code completely removed?  Can you look at the body column in smf_messages table in your database? Find the messag ID and check the contents... is the Img code in there?

If the Img is no longer even present,
It sounds like you might have something that is preparing your submissions and removing images...

Can you post a URL by itself, not in Img tags?
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 29, 2016, 09:36:16 AM
I've put more text in. The image in the signature block does work...

When I go to edit the post or look at source, the img code is removed. I'll check the database, though. That's a good thought.

I did check the full sources/post.php and subs.php code.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 29, 2016, 09:39:43 AM
Absolutely no tags in the message source. Whatever is happening, it's wiping them out on posting. I checked the post.php source against the untainted original, as noted earlier.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 29, 2016, 12:23:18 PM
I went into the database and added

test [ img ]https://www.allpar.com/icon/H/wagoneer.jpg[ /img ] (I did this manually in the database)

and it does work, so it is stripping the [img] on posting, which suggests a stray admin setting, but I did look at all of them... I think. Or a package manually uploaded sometime in the distant past, but would that not affect Post.php ? Which I checked against source.
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on November 29, 2016, 04:55:46 PM
Actually, I might think that it has to do with your HOST....   I suspect that they added some "security" BS which is stripping the stuff in a POST command...
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 29, 2016, 04:57:42 PM
mod_secure, you think? I can try changing hosts, it just seemed a little drastic.
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on November 29, 2016, 04:59:12 PM
it could be mod_security... but that usually just rejected theload completely, not strip our specific content.

I dunno for sure... but it seems to be happening SERVER SIDE...  which means that you should check with your host as to what they may have changed recently
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 29, 2016, 05:00:46 PM
Not sure when the problem started.

It isn't mod_secure, I can shut that off myself.

I do have some control so if I know roughly what to look for, it would help.

Otherwise, guess I will have to change hosts - which as you know is not a walk in the park. (Also not a walk through downtown Camden.)
Title: Re: Won’t post linked images... no matter what size/site
Post by: Illori on November 29, 2016, 05:43:39 PM
are you sure you can really disable mod_security? most hosts dont allow that. also would you mind if we closed out your help desk ticket? i dont think you will get better replies then those that you have gotten here already.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on November 30, 2016, 10:18:36 AM
Yes, they let me disable it on a site by site basis. Feel free to close the help desk ticket, I can always start over if moving doesn't help.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on December 01, 2016, 01:11:11 PM
New host, couple of hours burned, and the same problem. If I insert
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.dippy.org%2Fforum2%2FThemes%2Fcore%2Fimages%2Fwarn.gif&hash=bb81ba3a5006e882d85c962f48708b3e3621c67c)
into the database using bbcode, it works. Therefore it's something that happens while posting.

What other source files should I be checking against originals?
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on December 01, 2016, 04:58:18 PM
something is stripping out the img BBC completely, before it gets posted. I can not imagine what would be doing that in SMF code.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on December 01, 2016, 07:27:25 PM
Yes. That is what is happening. I wonder if the preference for bbcode is showing as being enabled, when it is not.

Do you know what files are involved in a post?
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on December 01, 2016, 09:59:23 PM
a bunch, actually.

You could always try loading a clean set of files and then re-applying your themes and mods, one at a time.


but as I said, I can not think of anything in SMF that would be causing that behavior
Title: Re: Won’t post linked images... no matter what size/site
Post by: Shambles on December 02, 2016, 01:48:13 AM
Does the issue occur when using  the wysiwyg editor also?
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on December 02, 2016, 09:18:58 AM
Yes, it applies however you post.
Title: Re: Won’t post linked images... no matter what size/site
Post by: nend on December 02, 2016, 11:07:06 AM
If I am understanding correctly, the images show when you preview the post?

The preview function is similar to the sansitization and parsing done when a post is sent to the db. So if your seeing the preview ok, but after posting the tags are removed, the chances are that either a modification changed something somewhere or something is going on with the database.
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on December 02, 2016, 11:12:30 AM
Nothing is wrong with the database, so it must be a modification, but I'm not showing any that would be likely to be the problem. Yes, preview does work. Does this narrow down which files I should be looking at>?
Title: Re: Won’t post linked images... no matter what size/site
Post by: Kindred on December 02, 2016, 12:24:11 PM
what mods do you have installed?
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on December 02, 2016, 04:14:40 PM
Bad Behavior
CheckBeforePosting
RSS Feed Poster
Resize Attached Images (not currently active)
Ad Management
Google Maps
Something that lets people mark topics as solved

I'm going through file by file now...
Title: Re: Won’t post linked images... no matter what size/site
Post by: postpar on December 02, 2016, 04:32:48 PM
Resolved. It was a line in Subs-Post.php of unknown provenance! Finally got my head in gear, downloaded the Sources folder, and used CompareMerge to get file-level, then line-level comparisons.

Thanks for trying, anyway. I appreciate your sticking with it.

PS> Yes, the initial "it's your fault" diagnosis was correct. That said, Post.php and Subs-post.php are the clear places to look. I missed the one line of bad code in there (not something I would have added myself, it's got to be from a package!) until I took it onto my desktop and used a graphical comparison program - a lesson there for anyone with a weird problem. Reinstalling all files and then packages would have worked, too, I guess... but a longer process.