Support ⇒ New installations ⇒ Multiple images appear to break code ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexNew installations

Multiple images appear to break code Reply to topic


So on a brand new clean install on 9.3.4.1 ... anytime I post a single image, it is fine, but anytime I post multiple images , it seems to break the code and treat all spaces kind of like an url and replaces it with %20.

I took screenshots of it and uploaded them into the gallery here for me to add into a post, but I guess images need admin approval before they are av visible.

And this happens in the default theme as well. It's not heavily modified at all yet really and not sure what is going on with it, doesn't appear to be anything I'm doing wrong. Sad

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


Well, decided I would just throw them up so didnt have to wait for them to be approved in the gallery here.

So the image is a purple sphere, to be used as a bullet for a list.

Below is the list, with just the single bullet being added:



All looks fine.

Then you add the second image, and this is where it goes all wonky:



Anything above the last image posted appears to break the code.

Here is the list with a third bullet image used:



So below that you can see the code that was actually being used and what the preview is showing. This happens in the default message feature on the front page as well, so it's not the module that is being shown in these screenshots that is the culprit.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


Ahhh check it out! It is happening on this site as well apparently!!!

See what I mean? It's hecka funky.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


My fix is here.

I've fixed in my Enhanced BBCode, or you can just find, around line 500, and remove the 2 unnecessary/erroneous lines in nbbcode.php:
$patterns[] = "#\[img\]([\w]+(://|\.|/)(?:%20|[^ \?%=&("\n\r\t<\\\])*?)\[/img\]#si";
$replacements[] = "<img src="\\1" alt="" />";

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


replace line 500 with
	$patterns[] = "#\[img\](^\].*)\[/img\]#sie";

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


I liked the enhanced bbc code, but have seen it not seem to "play nice" when combining a bunch of different colors, sizes, bolds, and italics - it seems to cancel itself out if there is a lot on a single page.

I will go do that fix right now! But maybe that needs to be fixed permanently in the code that is being offered for download?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1]


Remember with either BBCode that if you use multiple BBCodes, then you must close them in the reverse order you set them. Eg. bold -> italic -> /italic -> /bold.

If you have a specific case, I'd be happy to take a look.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


alyssa wrote
But maybe that needs to be fixed permanently in the code that is being offered for download?


Its already in v9CVS, v9 and v10 code.google, next release will contain this and other few small fixes.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


To all readers, removing the lines that layingback ask you to remove, will open all kind of security risks.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


I didn't ASK anyone to do anything! I'm just glad that alyssa raised the problem here so that it finally got fixed.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4

All times are UTC


Jump to: