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/Models/Feed.php +16 -6 2.7.72.10.0 View file →
@@ -105,8 +105,19 @@
105 105 ];
106 106
107 107 public static $scopeType = 'text';
108 108
109 + /**
110 + * The types a /post/{slug} URL can serve.
111 + *
112 + * fcom_posts is shared: it also holds course_lesson, course_section and
113 + * space_page rows, and each of those owns a different route. Any lookup that
114 + * drops the type global scope to reach image and article posts must narrow to
115 + * this list, or a feed URL can answer with a lesson or a page that happens to
116 + * share the slug. Add a new feed shape here when one is introduced.
117 + */
118 + public static $feedViewTypes = ['text', 'image', 'article'];
119 +
109 120 public static function boot()
110 121 {
111 122 parent::boot();
112 123
@@ -155,9 +166,9 @@
155 166 // get the first 40 char from the title
156 167 $title = mb_substr($title, 0, 40, 'UTF-8');
157 168 } else {
158 169 // get the first 25 char from the message
159 - $title = mb_substr($newModel->message, 0, 40, 'UTF-8');
170 + $title = mb_substr((string) $newModel->message, 0, 40, 'UTF-8');
160 171 }
161 172
162 173 $title = Helper::normalizeToAscii($title);
163 174 $title = remove_accents($title);
@@ -284,13 +295,12 @@
284 295 ) {
285 296 return $query->whereIn('status', [ 'published', 'pending' ]);
286 297 }
287 298
288 - // This is a normal User.
289 - return $query->where(function ($q) use ($user) {
290 - $q->where('status', 'published')
291 - ->orWhere(function ($q) use ($user) {
292 - $q->where('status', 'pending')
299 + return $query->where(function ($statusQuery) use ($user) {
300 + $statusQuery->where('status', 'published')
301 + ->orWhere(function ($subQuery) use ($user) {
302 + $subQuery->where('status', 'pending')
293 303 ->where('user_id', $user->ID);
294 304 });
295 305 });
296 306 }