Get rid of $GLOBALS['entry']. (#55)

See <https://board.s9y.org/viewtopic.php?f=4&t=21256&p=10447310#p10447310>.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2017-05-16 22:55:46 +02:00 committed by onli
parent a4bc0e32d3
commit d17bdd9f0b
2 changed files with 5 additions and 2 deletions

View file

@ -1,3 +1,6 @@
0.12.1:
* Fix use of description from the metadesc-plugin
0.12:
* Ignore smileys graphics for og:image
* Use entry picture from the timeline theme if set

View file

@ -16,7 +16,7 @@ class serendipity_event_social extends serendipity_event {
$propbag->add('description', PLUGIN_EVENT_SOCIAL_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'onli, Matthias Mees, Thomas Hochstein');
$propbag->add('version', '0.12');
$propbag->add('version', '0.12.1');
$propbag->add('requirements', array(
'serendipity' => '2.0'
));
@ -149,7 +149,7 @@ class serendipity_event_social extends serendipity_event {
echo '<meta name="twitter:card" content="summary" />' . "\n";
echo '<meta property="og:title" content="' . serendipity_specialchars($entry['title']) . '" />' . "\n";
# get desciption from serendipity_event_metadesc, if set; take first 200 chars from body otherwise
$meta_description = strip_tags($GLOBALS['entry'][0]['properties']['meta_description']);
$meta_description = strip_tags($entry['properties']['meta_description']);
if (empty($meta_description)) {
# /\s+/: multiple newline and whitespaces
$meta_description = trim(preg_replace('/\s+/', ' ', substr(strip_tags($entry['body']), 0, 200))) . '...';