Skip to content

Commit

Permalink
Special chars like quote not shown in plugin sidebar announcement #1372
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Mar 5, 2023
1 parent 2ac81a2 commit a5b9ade
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions adm_plugins/sidebar_announcements/sidebar_announcements.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
* Plugin that lists the latest announcements in a slim interface and
* can thus be ideally used in a sidebar
*
* Compatible with Admidio version 4.1
*
* @copyright 2004-2023 The Admidio Team
* @see https://www.admidio.org/
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 only
***********************************************************************************************
*/
$rootPath = dirname(dirname(__DIR__));
$rootPath = dirname(__DIR__, 2);
$pluginFolder = basename(__DIR__);

require_once($rootPath . '/adm_program/system/common.php');
Expand All @@ -27,7 +25,7 @@
$getDateFrom = admFuncVariableIsValid($_GET, 'date_from', 'date');
$getDateTo = admFuncVariableIsValid($_GET, 'date_to', 'date');

// set default values if there no value has been stored in the config.php
// set default values if no value has been stored in the config.php
if (!isset($plg_announcements_count) || !is_numeric($plg_announcements_count)) {
$plg_announcements_count = 2;
}
Expand Down Expand Up @@ -96,8 +94,8 @@
if ($plg_max_char_per_word > 0) {
$plgNewHeadline = '';

// Woerter unterbrechen, wenn sie zu lang sind
$plgWords = explode(' ', SecurityUtils::encodeHTML($plgAnnouncement->getValue('ann_headline')));
// Interrupt words if they are too long
$plgWords = explode(' ', $plgAnnouncement->getValue('ann_headline'));

foreach ($plgWords as $plgValue) {
if (strlen($plgValue) > $plg_max_char_per_word) {
Expand All @@ -109,7 +107,7 @@
}
echo $plgNewHeadline.'</a></h5>';
} else {
echo SecurityUtils::encodeHTML($plgAnnouncement->getValue('ann_headline')).'</a></h5>';
echo $plgAnnouncement->getValue('ann_headline').'</a></h5>';
}

// show preview text
Expand Down

0 comments on commit a5b9ade

Please sign in to comment.