fix context filters

This commit is contained in:
Jean-Christian Paul Denis 2021-08-23 15:22:15 +02:00
parent a5d4f0d467
commit 59583a33d0
3 changed files with 16 additions and 25 deletions

View File

@ -1,3 +1,6 @@
fac 0.8.1
* fix context filters
fac 0.8 - 2021-08-19 fac 0.8 - 2021-08-19
* update license * update license
* fixed PSR2 coding style * fixed PSR2 coding style

View File

@ -19,7 +19,7 @@ $this->registerModule(
'fac', 'fac',
'Add RSS/Atom feeds after entries content', 'Add RSS/Atom feeds after entries content',
'Jean-Christian Denis and Contributors', 'Jean-Christian Denis and Contributors',
'0.8', '0.8.1',
[ [
'permissions' => 'usage,contentadmin', 'permissions' => 'usage,contentadmin',
'type' => 'plugin', 'type' => 'plugin',

View File

@ -133,7 +133,10 @@ class facPublic
if ($core->blog->settings->fac->fac_showfeeddesc if ($core->blog->settings->fac->fac_showfeeddesc
&& '' != $feed->description) { && '' != $feed->description) {
$feeddesc = $feeddesc =
'<p>' . context::global_filter($feed->description, 1, 1, 0, 0, 0) . '</p>'; '<p>' . context::global_filters(
$feed->description,
['encode_xml', 'remove_html']
) . '</p>';
} }
# Date format # Date format
@ -157,7 +160,7 @@ class facPublic
$date = dt::dt2str($dateformat, $item->pubdate); $date = dt::dt2str($dateformat, $item->pubdate);
# Entries title # Entries title
$title = context::global_filter( $title = context::global_filters(
str_replace( str_replace(
array( array(
'%D', '%D',
@ -175,15 +178,11 @@ class facPublic
), ),
$format['linestitletext'] $format['linestitletext']
), ),
0, ['remove_html', 'cut_string' => abs((integer) $format['linestitlelength'])],
1,
abs((integer) $format['linestitlelength']),
0,
0
); );
# Entries over title # Entries over title
$overtitle = context::global_filter( $overtitle = context::global_filters(
str_replace( str_replace(
array( array(
'%D', '%D',
@ -201,11 +200,7 @@ class facPublic
), ),
$format['linestitleover'] $format['linestitleover']
), ),
0, ['remove_html', 'cut_string' => 350],
1,
350,
0,
0
); );
# Entries description # Entries description
@ -213,12 +208,9 @@ class facPublic
if ($format['showlinesdescription'] if ($format['showlinesdescription']
&& '' != $item->description) { && '' != $item->description) {
$description = '<dd>' . $description = '<dd>' .
context::global_filter( context::global_filters(
$item->description, $item->description,
0, ['remove_html' => (integer) $format['linesdescriptionnohtml'], 'cut_string' => abs((integer) $format['linesdescriptionlength'])]
(integer) $format['linesdescriptionnohtml'],
abs((integer) $format['linesdescriptionlength']),
0,0
) . '</dd>'; ) . '</dd>';
} }
@ -227,13 +219,9 @@ class facPublic
if ($format['showlinescontent'] if ($format['showlinescontent']
&& '' != $item->content) { && '' != $item->content) {
$content = '<dd>'. $content = '<dd>'.
context::global_filter( context::global_filters(
$item->content, $item->content,
0, ['remove_html' => (integer) $format['linescontentnohtml'], 'cut_string' => abs((integer) $format['linescontentlength'])]
(integer) $format['linescontentnohtml'],
abs((integer) $format['linescontentlength']),
0,
0
) . '</dd>'; ) . '</dd>';
} }