From 59583a33d06627733838002bc3fba5d37675b53b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 23 Aug 2021 15:22:15 +0200 Subject: [PATCH] fix context filters --- CHANGELOG.md | 3 +++ _define.php | 2 +- _public.php | 36 ++++++++++++------------------------ 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df2838d..57f026b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +fac 0.8.1 + * fix context filters + fac 0.8 - 2021-08-19 * update license * fixed PSR2 coding style diff --git a/_define.php b/_define.php index bc9ca90..43768ba 100644 --- a/_define.php +++ b/_define.php @@ -19,7 +19,7 @@ $this->registerModule( 'fac', 'Add RSS/Atom feeds after entries content', 'Jean-Christian Denis and Contributors', - '0.8', + '0.8.1', [ 'permissions' => 'usage,contentadmin', 'type' => 'plugin', diff --git a/_public.php b/_public.php index 2b535f4..8910498 100644 --- a/_public.php +++ b/_public.php @@ -133,7 +133,10 @@ class facPublic if ($core->blog->settings->fac->fac_showfeeddesc && '' != $feed->description) { $feeddesc = - '

' . context::global_filter($feed->description, 1, 1, 0, 0, 0) . '

'; + '

' . context::global_filters( + $feed->description, + ['encode_xml', 'remove_html'] + ) . '

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