News:

Wondering if this will always be free?  See why free is better.

Main Menu

Attachments Error

Started by DarkAngel612, July 31, 2014, 04:24:33 PM

Previous topic - Next topic

DarkAngel612

2.0.8, fresh install

This is what we got with an image that was being set for attaching to post:

Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator.

In attachment settings :

Check attachment's extension: checked  Allowed attachment extensions: doc,gif,jpg,mpg,pdf,png,txt,zip,xls,pz2,cr2,psd,ds,obj,pz3  Recode line endings in textual attachments: uncheckedRe-encode and performing extensive security checks: unchecked
No problems until today trying to add any attachments until this image and its info
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Kindred

I bet that you are uploading an image attachment and that the image was edited in photoshop....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DarkAngel612

Well when I tried to search here it did not come up with anything...but I kept trying and google found this and it worked:


Thanks to Margaret!

in Subs-Graphics.php

FIND:
            // Check for potential infection
            if (preg_match('~(iframe|html|eval|body|script\W|[CF]WS[\x01-\x0C])~i', $prev_chunk . $cur_chunk, $matches) === 1)

REPLACE:

            // Check for potential infection
            if (preg_match('~(iframe|(?<!cellTextIs)html|eval|body|script\W|[CF]WS[\x01-\x0C])~i', $prev_chunk . $cur_chunk, $matches) === 1)


Will allow images with that particular html "tag" to pass but other html tags will still fail.



There's something related to Photoshop images or whatever...



If you want to bypass that completely, just edit Sources/Subs-Graphics.php


FIND:

function checkImageContents($fileName, $extensiveCheck = false)
{

ADD AFTER:

    return true;


Yes our images are 95% Photoshop since we are an art site and art store with texture artists and their wares to sell or give out.
I tested it after changing the code and it loaded her image.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Newbergian

This topic is an old string but still a problem on the Forum I am visiting. I could not get my Photoshop adjusted jpg images to upload. Kept getting the subject security msg.

My workaround for future users: My images seem (so far) to upload without problem if I save using: File, Save For The Web... and save as a GIF. Perhaps the Save For The Web ... selection would also allow a .jpeg to work but I didn't try that because GIF works and I'm done,,,,

adios

DarkAngel612

My forum did the same thing and I did the  "fix" that Margaret wrote above your reply even in 2.011, it needs to be done with each time the site gets upgraded files. I did both the edites she mentions not just the first one and our .jpgs have been behaving.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

SaltedWeb

I am getting the same error tried both the fixes and actually one fix was already in place and this is a new forum.
The users are not using photoshop but pictures off their phones and getting these errors.
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Advertisement: