WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 19.09.2019 15:40:04

losttrip
Member

Gallery Image Caption can not contain apostrophe

Title says it all.  If I add a caption containing an apostrophe, the caption is blank after saving.

Offline

#2 19.09.2019 15:51:15

florian
Administrator

Re: Gallery Image Caption can not contain apostrophe

will be fixed in the next version of the module.
For a quick fix, open modules/news_img/save_post.php and change line 348

? strip_tags($_POST['picdesc'][$row_id])

to

? $database->escapeString(strip_tags($_POST['picdesc'][$row_id]))

Sorgen sind wie Nudeln: man macht sich meist zu viele.

Offline

#3 25.09.2019 00:33:06

losttrip
Member

Re: Gallery Image Caption can not contain apostrophe

Thank you.  Thank you to everyone who is involved in this project.  Having a gallery in a News post has been a long wish of mine/my clients.

I also just noticed that having an apostrophe in the post DESCRIPTION causes issues.  For instance the ALT tag which uses the DESCRIPTION is broken at the apostrophe.

Offline

#4 25.09.2019 06:15:35

florian
Administrator

Re: Gallery Image Caption can not contain apostrophe

There is no input fiel description, which one do you mean?

But you're right, if theres an apostrophe in the title, the alt tag of the post link looks like this

alt='Don't' 

since all attributes are written in single quotes, so change in the view.php line 287 to

$group_image = "<img src=\"".$group_image."\" alt=\"".$group_title."\" />";

and line 297ff to

if ($post['image'] != "") {
                    $post_img = '<img src="'.WB_URL.MEDIA_DIRECTORY.'/.news_img/'.$post['post_id'].'/'.$post['image'].'" alt="'.$post['title'].'" />';
                } else {
                    $post_img = '<img src="'.WB_URL.'/modules/news_img/images/nopic.png" alt=""/>';
                }

Sorgen sind wie Nudeln: man macht sich meist zu viele.

Offline

#5 25.09.2019 09:49:09

losttrip
Member

Re: Gallery Image Caption can not contain apostrophe

I'm referring to the teaser pic in the post loop.  In the output html, it shows the alt as:

<img src="https://www.mysite.com/media/.news_img/4/img_20190917_163417_1.jpg" alt="I" ve="" discovered="" a="" new="" love'="">

So the output alt tag is "I" and that's all.

I thought it might have something to do with the fotorama Image Loop:

<img src="[IMAGE]" alt="[DESCRIPTION]" title="[DESCRIPTION]" data-caption="[DESCRIPTION]" />

Where DESCRIPTION is used as the alt.

Offline

#6 25.09.2019 10:07:28

florian
Administrator

Re: Gallery Image Caption can not contain apostrophe

For the teaser pic, I've posted the quick fix above. We will fix that in the upcoming version of NWI too.
With the (fotorama) gallery images, there are as far as I see no issues when using an apostrophe.


Sorgen sind wie Nudeln: man macht sich meist zu viele.

Offline

#7 26.09.2019 01:08:05

losttrip
Member

Re: Gallery Image Caption can not contain apostrophe

Thank you again!

Offline

Board footer

up