Announcement

  •  » Extensions
  •  » Metadata Open Graph description error

#1 2020-05-02 22:34:28

mjp
Member
2018-03-03
2

Metadata Open Graph description error

Hello,

First hello and thanks for Piwigo (this is my first post)

I have found one problem with new Metadata Open Graph extension: if description contains HTML tags the og:description property is not stripped of them, which causes problems, eg.:

Code:

<meta property="og:description" content="
13 May 2019
<!--complete-->
<div class="title">Poznań</div>
">

Piwigo version: 2.10.2
PHP version: 7.4
MySQL version: 5.5.5

Offline

 

#2 2020-05-03 08:16:05

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7207

Re: Metadata Open Graph description error

Hi :-)

you've html in your description ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2020-05-03 08:26:36

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7207

Re: Metadata Open Graph description error

Hi :-)

can you go
http://piwigo.org/svn/extensions/meta_og/


download main.inc.php and test


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#4 2020-05-03 15:05:20

mjp
Member
2018-03-03
2

Re: Metadata Open Graph description error

Thanks!

Yes, I use Extended Description plugin and some HTML tags to make my album descriptions look the way I want.

The updated version works better, but for some reason is not fully compatible with Extended Description. The [lang] tag works fine, but <!--complete--> <!--more--> do not work as expected. I tried to change in your code

Code:

  if (isset($pwg_loaded_plugins['ExtendedDescription'])){
    add_event_handler('AP_render_content', 'get_user_language_desc');

to

Code:

  if (isset($pwg_loaded_plugins['ExtendedDescription'])){
    add_event_handler('AP_render_content', 'get_extended_desc');

which shoudl be more generic, but it did not work neither. Any ideas?

Offline

 

#5 2020-05-03 15:32:47

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7207

Re: Metadata Open Graph description error

Hi :-)

@mjp
for more / complete ... I must see but I don't know yet what I chose for the tag


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#6 2020-05-08 01:49:15

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7207

Re: Metadata Open Graph description error

Hi :-)

new bera relase

if plugin Extended descriptions is activate, on album page only short description or top description is use for og:description


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2020-06-07 11:40:58

localhost
Member
2020-06-07
1

Re: Metadata Open Graph description error

Hi,

Just registered here to post about a pretty similar/related issue, so I guess it's appropriate to use this thread (sorry if it isn't).

I just installed version 0.7.beta7 of Metadata Open Graph, and I noticed that quotes are not escaped in the description, causing a pretty bad bug when the description does contain quotes (actually I'm surprised it doesn't totally break the page).

For instance, if you check the source code of this page https://gal.patheticcockroach.com/picture.php?/53/ , you'll notice (text truncated by me for clarity):

Code:

<meta property="og:description" content="The Sixth Sense version of the well-known "I see dumb people"">

I would expect something like:

Code:

<meta property="og:description" content="The Sixth Sense version of the well-known &quot;I see dumb people&quot;">

I suspect we're missing a htmlspecialchars() somewhere ?

Offline

 

#8 2020-06-07 17:40:28

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7207

Re: Metadata Open Graph description error

Hi :-)

Thanks for your post I look when I look


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 
  •  » Extensions
  •  » Metadata Open Graph description error

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact