Image that are dynamic (with PHP)

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Image that are dynamic (with PHP)

Post by apprentifinancier »

Hi,

I have participate to some phpbb forum and I was able to put those tag:

Image

AND instead of having the code appear, the real image was showing.

I have create my own forum, AND I would like to be able to show those dynamic image... how can I activate it ?


SOrry I am a newby with phpbb. :roll:
geocator
Registered User
Posts: 16242
Joined: Fri Jan 09, 2004 11:56 pm
Location: On dry land
Contact:

Post by geocator »

This has been disabled for security reasons. Allowing linking to anything but real images poses great danger to your users.
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

geocator wrote: This has been disabled for security reasons. Allowing linking to anything but real images poses great danger to your users.


OK, but If I do limit this for image that are only in my domain that will cause no more danger.

Can you tell me where to go?
geocator
Registered User
Posts: 16242
Joined: Fri Jan 09, 2004 11:56 pm
Location: On dry land
Contact:

Post by geocator »

I have a strict policy of not telling people how to reduce the security of their board. If they are competent enough to handle the risk and take proper precautions, then they can figure it out on their own. Sorry.
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

Are you joking me? I am asking support because I want to be sure to not open a hole, instead you tell me to "try it by myself"... well thx for the hint, I'll do my best now... php is server side... it won't kill my user... it has more chance to kill "me" if I do something wrong... anyways... :roll:
User avatar
Lumpy Burgertushie
Registered User
Posts: 68587
Joined: Mon May 02, 2005 3:11 am
Contact:

Post by Lumpy Burgertushie »

you missed the point. we are not going to tell you how to bypass the security of the program.

if you do figure out how to do it, that means you are smart enough to protect yourself as well.

if not, then you don't need to know how to do it.

robert

p.s. why not just link to the actual images and keep the security in place .
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

The image is generated with data that change every minute.

My users need to have theses images loaded often (it represent stock market %).

So, my server doesn't have the file on the server, it's generated every load time.

It's weird, because that must be a "security" that has been released not long time ago because I can do it in a lots of forum but not on the last version of phpbb... if it's a real pain to change it, I will just download a old version of phpbb.
User avatar
Anon
Former Team Member
Posts: 7019
Joined: Fri Jan 02, 2004 7:33 am
Location: Christchurch, New Zealand

Post by Anon »

As has been said, this is a major security risk. However if you wish to do this without modifying the board files here's a hack. What you can do is put the link to tinyurl.com (since the pharser doesn't like ?= in Image tags). Then when you get the url (in this case, http://tinyurl.com/ydeo88 )put it in Image. It will turn out like


Image
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

Thx Anon, that's already a better solution. Problem is that the tag after the ? is required to get the image for the user.

Ok.

File : bbcode.php

We have :

Code: Select all

	// [img]image_url_here[/img] code..
	$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
and

Code: Select all

	// [img]image_url_here[/img] code..
	// This one gets first-passed..
	$patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i";
	$replacements[] = $bbcode_tpl['img'];
Someone can tell me if "the" solution is near of those regex pattern?
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

I'll simply do with php a simple replace of [img][/img] by <img src=""/>........

Thx guys ... I am sure that open more hole security that the simple solution I wanted but that's life, it needs to be done.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68587
Joined: Mon May 02, 2005 3:11 am
Contact:

Post by Lumpy Burgertushie »

so now you have enables html on your board which is even more insecure than the other problem

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

well I need to get only a dynamic (PHP) picture from MY website to MY forum... it only needs a modification to the regex but none can help me, so life has to continue, so for the moment, I take off all security, what can I do...

I might download a very old version of PHPBB to get the old version of the BBCode transformation ...
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

Hi,

I have downloaded the version 2.0. The BBCODE in the folder includes is not the same, when I replace with this older version, the image still doesn't show.

Anyone know what file I need to change? Or which version will let me post what I want? Thx
beatme101
Registered User
Posts: 2866
Joined: Sat Jan 01, 2005 6:20 am
Location: The country cold comes from; Canada.
Contact:

Post by beatme101 »

There is no version of phpBB2 that will let you do what you want. Do not try to change the code or use an old version, your forum will not last very long with the hacking bots crawling around dicing through old forums. Make a folder in your web hosting called "image.jpg" and put an index.php in that folder that generates the image you want, then just link the image tags to the folder. Like my avatar.
apprentifinancier
Registered User
Posts: 11
Joined: Wed Dec 27, 2006 6:14 pm

Post by apprentifinancier »

beatme101 wrote: There is no version of phpBB2 that will let you do what you want. Do not try to change the code or use an old version, your forum will not last very long with the hacking bots crawling around dicing through old forums. Make a folder in your web hosting called "image.jpg" and put an index.php in that folder that generates the image you want, then just link the image tags to the folder. Like my avatar.


Ok but why does it works on some PHPBB otherelse than mine! I do not want to create something new, some forum does let me do that.

Your idea is fine but I won't be able to put some parameter to this image (i need to put the user id to show the image for the user).
Locked

Return to “2.0.x Support Forum”