WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

Du bist nicht angemeldet.

#1 19.09.2019 16:40:04

losttrip
Mitglied

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.

Online

#2 19.09.2019 16: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]))

Code allein macht nicht glücklich. Jetzt spenden!

Offline

#3 25.09.2019 01:33:06

losttrip
Mitglied

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.

Online

#4 25.09.2019 07: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=""/>';
                }

Code allein macht nicht glücklich. Jetzt spenden!

Offline

#5 25.09.2019 10:49:09

losttrip
Mitglied

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.

Online

#6 25.09.2019 11: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.


Code allein macht nicht glücklich. Jetzt spenden!

Offline

#7 26.09.2019 02:08:05

losttrip
Mitglied

Re: Gallery Image Caption can not contain apostrophe

Thank you again!

Online

Fußzeile des Forums

up