PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.10.0
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.10.0
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
← All changes | app/Services/LockscreenService.php +19 -1 2.7.72.10.0 View file →
@@ -67,9 +67,9 @@
67 67
68 68 foreach ($settings as &$setting) {
69 69 if ($viewOnly && Arr::get($setting, 'type') === 'block' && !empty($setting['content'])) {
70 70 $user = Helper::getCurrentUser();
71 - $content = apply_filters('the_content', $setting['content']); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
71 + $content = self::renderBlockContent($setting['content']);
72 72 $setting['content'] = (new SmartCodeParser())->parse($content, $user);
73 73 }
74 74
75 75 if (Arr::get($setting, 'type') == 'image' && empty($setting['new_tab'])) {
@@ -77,8 +77,26 @@
77 77 }
78 78 }
79 79
80 80 return apply_filters('fluent_community/lockscreen_fields', $settings, $space);
81 + }
82 +
83 + /**
84 + * Renders without the_content: a space admin need not hold unfiltered_html, and
85 + * the_content's do_shortcode pass would run their shortcodes for every visitor.
86 + */
87 + protected static function renderBlockContent($content)
88 + {
89 + $rendered = do_blocks(strip_shortcodes($content));
90 +
91 + // Core skips wpautop for block content to avoid mangling it.
92 + if (!has_blocks($content)) {
93 + $rendered = wpautop($rendered);
94 + }
95 +
96 + $rendered = wptexturize($rendered);
97 +
98 + return wp_filter_content_tags($rendered);
81 99 }
82 100
83 101 public static function formatLockscreenFields($settingFields, $space)
84 102 {