https://www.icyphoenix.com/viewtopic.php?f=4&t=1518
-----------------------------------
Zuker
Thu 05 Apr, 2007 15:51

DEBUG - Why Some Images Are Not Shown In Posts?
-----------------------------------
Some images are blocked because of errors...

[b]Errors may be related to:[/b]

[list][*]Corrupted file
[*]Wrong file format (named as PNG while not being a PNG for example)
[*]Possible hacking attempt (so the script blocks the image and insert a No Thumb instead)
[*]Unknown error[/list]


-----------------------------------
Mighty Gorgon
Sun 08 Apr, 2007 11:16

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
Not only...

It may depends on several reasons.

Before raising a bug for this, try to check that your server support GD libraries, otherwise you should disable Thumbnails in posts and any images resizing function.

Thumbnails in posts are not correctly generated for images with spaces in their names or with special chars in it: I've decided to force the function to generate thumbnails only for images with regular names for security reasons.

Any invalid chars in the names will block the script. Use images with alphanum chars in the name instead.

If you want to show all images I can post the code to allow all images, but [color=#DD1010]do it at your own risk[/color] and I won't help you in solve problems that may arise from this. You are deliberately opening security holes on your site :wink: .


-----------------------------------
toledo
Wed 23 May, 2007 13:44

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
yeah for some reason users cannot upload BMP images!! why is this?


-----------------------------------
Mighty Gorgon
Fri 25 May, 2007 01:40

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
BMP are not allowed... they are obsolete, and I cannot see reasons to use them in the web... :roll:


-----------------------------------
toledo
Fri 25 May, 2007 14:09

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
[quote user="Mighty Gorgon" post="15001"]BMP are not allowed... they are obsolete, and I cannot see reasons to use them in the web... :roll:[/quote]

anyway to allow them?


-----------------------------------
Mighty Gorgon
Sat 26 May, 2007 02:14

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
[quote user="toledo" post="15065"][quote user="Mighty Gorgon" post="15001"]BMP are not allowed... they are obsolete, and I cannot see reasons to use them in the web... :roll:[/quote]

anyway to allow them?[/quote]
Open UPLOAD.PHP and change this string:
[codeblock]$filetypes = 'jpg,gif,png';[/codeblock]


-----------------------------------
toledo
Sat 26 May, 2007 18:50

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
[quote user="Mighty Gorgon" post="15198"][quote user="toledo" post="15065"][quote user="Mighty Gorgon" post="15001"]BMP are not allowed... they are obsolete, and I cannot see reasons to use them in the web... :roll:[/quote]

anyway to allow them?[/quote]
Open UPLOAD.PHP and change this string:
[codeblock]$filetypes = 'jpg,gif,png';[/codeblock][/quote]

Great now i can allow any image type!!


-----------------------------------
isb1009
Mon 04 Jun, 2007 13:44

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
So...
Could you post the code to allow creating thumbnails from images that have got special characters?
Many of my images have got dashes (-) and many other symbols for naming reasons.
For example, http://astronomipedia.quae.net/test/foro/viewtopic.php?t=5
The first message in the post has got dashes in the name, but the second one is "normal".

I've got GD version 2, and thumbnails activated. The thumbnails folders are also CHMOD 777. And they work because the "normal" picture has got a thumbnail.

Could you write the code to allow the thumbnails of this images with special characters?

Thank you,


-----------------------------------
Mighty Gorgon
Tue 05 Jun, 2007 00:56

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
When I have some free time I'll try to do some tests... it's not good having some strange chars in files, because of special chars parsing in different charset... anyway I'll try to allow users to use this if they want... :roll:


-----------------------------------
isb1009
Tue 05 Jun, 2007 15:02

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
Thanks, Luca.
But... What are the security holes of allowing special characters in filenames?

Thank you again,


-----------------------------------
Mighty Gorgon
Sun 10 Jun, 2007 04:36

Re: Why Some Images Are Not Shown In Posts?
-----------------------------------
[quote user="isb1009" post="16061"]Thanks, Luca.
But... What are the security holes of allowing special characters in filenames?

Thank you again,[/quote]
If you allow some strange chars, you may be exposed to SQL and PHP injections/inclusions... that's why I've removed this possibility.


