Help me!! (script image img BBcode): SOLVED

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
cuprasteve
Registered User
Posts: 78
Joined: Tue Jul 18, 2006 10:04 pm

Help me!! (script image img BBcode): SOLVED

Post by cuprasteve » Sat Aug 12, 2006 4:30 pm

Hello,

I posted this question a while back, and after searching ever since cannot find an answer.

Basically I need to be able to enable the bbcode IMG tags to work with script generated images, id the images that are generated by php such as

Image

i wish to be able to put the tags around it to display, i understand it was disabled for security reasons, but I wouldve thought it fairly easy to renable for someone who knows the phpbb code well :)

cheers
Last edited by cuprasteve on Sat Aug 12, 2006 7:34 pm, edited 1 time in total.

AMD Power
Registered User
Posts: 2044
Joined: Tue Jun 27, 2006 2:16 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by AMD Power » Sat Aug 12, 2006 4:45 pm

I have read somewhere but cannot remember exactly who (probably beatme101) that link the image as folder like:

Code: Select all

[img]http://www.vagweb.co.uk/forums/picture.jpg[/img]
That picture.jpg is a folder, then he put index.php and put the link to a picture inside if I understand it correctly. I have no idea how to put your link inside index.php... maybe you got the idea...

_ollie_
Registered User
Posts: 654
Joined: Wed May 25, 2005 7:27 pm
Location: Berkshire
Contact:

Post by _ollie_ » Sat Aug 12, 2006 5:43 pm

Yea if I remember correctly, you cannot insert an image url, if the file extension is not in a valid format.

AMD Power
Registered User
Posts: 2044
Joined: Tue Jun 27, 2006 2:16 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by AMD Power » Sat Aug 12, 2006 5:48 pm

_ollie_ wrote: Yea if I remember correctly, you cannot insert an image url, if the file extension is not in a valid format.

Probably you're right.. It just a wild guess since I remember something like that...

beatme101
Registered User
Posts: 2866
Joined: Sat Jan 01, 2005 6:20 am
Location: The country cold comes from; Canada.
Contact:

Post by beatme101 » Sat Aug 12, 2006 6:01 pm

AMD Power wrote: I have read somewhere but cannot remember exactly who (probably beatme101) that link the image as folder like:

Code: Select all

[img]http://www.vagweb.co.uk/forums/picture.jpg[/img]
That picture.jpg is a folder, then he put index.php and put the link to a picture inside if I understand it correctly. I have no idea how to put your link inside index.php... maybe you got the idea...


Yup, it was me.

Index.php, contained within the folder called picture.jpg, can contain a redirect to your php generated image by filling index.php with this:

Code: Select all

<?php
header("Location: http://www.vagweb.co.uk/forums/album_pic.php?pic_id=442");
?>


EDIT: And for future reference to the original poster.. Please use better topic titles..
Last edited by beatme101 on Sat Aug 12, 2006 6:03 pm, edited 1 time in total.

cuprasteve
Registered User
Posts: 78
Joined: Tue Jul 18, 2006 10:04 pm

Post by cuprasteve » Sat Aug 12, 2006 6:02 pm

interesting ideas there, this probably wouldnt work if the images were external, i wonder if there is a way to get it to work without having to add an extension, vbulletin and other boards work ok with it, does anyone think its a case of altering the valid extensions somewhere?

cuprasteve
Registered User
Posts: 78
Joined: Tue Jul 18, 2006 10:04 pm

Post by cuprasteve » Sat Aug 12, 2006 6:05 pm

beatme101 wrote:
AMD Power wrote:I have read somewhere but cannot remember exactly who (probably beatme101) that link the image as folder like:

Code: Select all

[img]http://www.vagweb.co.uk/forums/picture.jpg[/img]
That picture.jpg is a folder, then he put index.php and put the link to a picture inside if I understand it correctly. I have no idea how to put your link inside index.php... maybe you got the idea...


Yup, it was me.

Index.php, contained within the folder called picture.jpg, can contain a redirect to your php generated image by filling index.php with this:

Code: Select all

<?php
header("Location: http://www.vagweb.co.uk/forums/album_pic.php?pic_id=442");
?>


EDIT: And for future reference to the original poster.. Please use better topic titles..

would that then work for that image only?

beatme101
Registered User
Posts: 2866
Joined: Sat Jan 01, 2005 6:20 am
Location: The country cold comes from; Canada.
Contact:

Post by beatme101 » Sat Aug 12, 2006 6:06 pm

cuprasteve wrote: would that then work for that image only?


Correct, for each additional php image you want you will need to make another .jpg folder with a similar index.php contained within.

cuprasteve
Registered User
Posts: 78
Joined: Tue Jul 18, 2006 10:04 pm

Post by cuprasteve » Sat Aug 12, 2006 6:11 pm

ah so no easy solution to just allow any type of script image to work then :(

cuprasteve
Registered User
Posts: 78
Joined: Tue Jul 18, 2006 10:04 pm

Post by cuprasteve » Sat Aug 12, 2006 6:16 pm

can anyone point me in the direction then of where the valid file extensions are set?

cuprasteve
Registered User
Posts: 78
Joined: Tue Jul 18, 2006 10:04 pm

Post by cuprasteve » Sat Aug 12, 2006 7:35 pm

FIXED:

I replaced in includes\bbcode.php

Code: Select all

$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);
with

Code: Select all

$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \\#\"\n\r\t<]*)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
now works a treat :D

TheBrain2K
Registered User
Posts: 3
Joined: Mon Apr 23, 2007 8:38 am

Re: Help me!! (script image img BBcode): SOLVED

Post by TheBrain2K » Mon Apr 23, 2007 8:53 am

Since which version of phpBB do dynamic images work again ?

rvmomma
Registered User
Posts: 768
Joined: Fri Mar 09, 2007 5:23 pm

Re: Help me!! (script image img BBcode): SOLVED

Post by rvmomma » Mon Apr 23, 2007 1:25 pm

they don't. it was changed several versions ago because it allows people to run scripts on your board.

so, people that circumvent the security settings like the previous poster, have opened up their boards to hackers.

there is usually a very good reason for security measures that the staff here put into place.

TheBrain2K
Registered User
Posts: 3
Joined: Mon Apr 23, 2007 8:38 am

Re: Help me!! (script image img BBcode): SOLVED

Post by TheBrain2K » Mon Apr 23, 2007 7:11 pm

No, you misunderstood.
In THIS board right here, dynamic images ARE possible (see first post above or try it yourself).

So what I'm wondering is what Version of phpBB is running on this server, as the devs have either found a secure way to include images or I've just found a security hole in the phpbb.com-board, which seems rather unlikely.

Example:
Image
(img-tag inlcuding https://camo.phpbb.com/26e464c12a274ce225dcf8473ed1a5365b1c7dff/687474703a2f2f7777772e616e79646f6d61696e2e636f6d2f616e797363726970742e7068703f666f6f3d626172)

rvmomma
Registered User
Posts: 768
Joined: Fri Mar 09, 2007 5:23 pm

Re: Help me!! (script image img BBcode): SOLVED

Post by rvmomma » Tue Apr 24, 2007 1:08 am

Image

Locked

Return to “2.0.x Support Forum”