|
8 | 8 | // No direct access |
9 | 9 | defined('_HZEXEC_') or die(); |
10 | 10 |
|
| 11 | +// Skip rendering if the activity log is missing |
| 12 | +if (!$this->activity->log || !$this->activity->log->get('id')) |
| 13 | +{ |
| 14 | + return; |
| 15 | +} |
| 16 | + |
11 | 17 | $class = $this->activity->log->details->get('class', 'activity'); |
12 | 18 | $commentable = (!$this->activity->log->get('parent')); |
13 | 19 | $deletable = $this->model->access('manager'); |
|
16 | 22 |
|
17 | 23 | $creator = User::getInstance($this->activity->log->get('created_by')); |
18 | 24 |
|
| 25 | +// Skip rendering if both the creator and description are missing |
| 26 | +if (!$creator->get('id') && !trim($this->activity->log->get('description'))) |
| 27 | +{ |
| 28 | + return; |
| 29 | +} |
| 30 | + |
19 | 31 | $new = false; |
20 | 32 | if ($this->model->member()) |
21 | 33 | { |
|
25 | 37 | $recorded = $this->activity->get('created'); |
26 | 38 |
|
27 | 39 | $name = Lang::txt('JANONYMOUS'); |
| 40 | +$nameText = $name; |
28 | 41 |
|
29 | 42 | $online = false; |
30 | 43 |
|
|
33 | 46 | { |
34 | 47 | // Get their full name |
35 | 48 | $name = $this->escape(stripslashes($creator->get('name', Lang::txt('PLG_PROJECTS_ACTIVITY_UNKNOWN')))); |
| 49 | + $nameText = $name; |
36 | 50 |
|
37 | 51 | // Can we see their profile? |
38 | 52 | if (in_array($creator->get('access'), User::getAuthorisedViewLevels())) |
|
51 | 65 | <div class="activity-actor-picture<?php if ($online) { echo ' tooltips" title="' . Lang::txt('PLG_PROJECTS_FEED_ONLINE'); } ?>"> |
52 | 66 | <?php if ($showProject) { ?> |
53 | 67 | <span class="user-img-wrap"> |
54 | | - <img class="project-image" src="<?php echo Route::url($this->model->link('thumb')); ?>" alt="" /> |
| 68 | + <img class="project-image" src="<?php echo Route::url($this->model->link('thumb')); ?>" alt="<?php echo $this->escape($this->model->get('title')); ?>" /> |
55 | 69 | <?php if ($online) { ?> |
56 | 70 | <span class="online"><?php echo Lang::txt('PLG_PROJECTS_FEED_ONLINE'); ?></span> |
57 | 71 | <?php } ?> |
58 | 72 | </span> |
59 | 73 | <?php } else { ?> |
60 | 74 | <a class="user-img-wrap" href="<?php echo Route::url($creator->link()); ?>"> |
61 | | - <img src="<?php echo $creator->picture(); ?>" alt="" /> |
| 75 | + <img src="<?php echo $creator->picture(); ?>" alt="<?php echo $nameText; ?>" /> |
62 | 76 | <?php if ($online) { ?> |
63 | 77 | <span class="online"><?php echo Lang::txt('PLG_PROJECTS_FEED_ONLINE'); ?></span> |
64 | 78 | <?php } ?> |
|
0 commit comments