Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Geen lege albumnaam weergeven als de human name niet is ingevuld #38

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$album = '';
$order = 'id DESC';
$humanname = 'Fotoalbum';
$displayname = $humanname;
$parentalbums = array();
} else {
$row = getUnitByFullPath(substr($album, 0, -1));
Expand All @@ -36,6 +37,7 @@
$id = $row['id'];
$visibility = $row['visibility'];
$humanname = $row['humanname'];
$displayname = $humanname ?: $row['name'];
$order = 'name';
}

Expand Down Expand Up @@ -94,7 +96,7 @@
$albums[] = array(
'name' => $row['name'],
'fullpath' => $row['path'] . $row['name'],
'humanname' => $row['humanname'] ? $row['humanname'] : $row['name']
'displayname' => $row['humanname'] ?: $row['name'],
);
} else {
$photos[] = array(
Expand All @@ -121,10 +123,11 @@
template_assign('parentalbum');
}
template_assign('parentalbums');
template_assign('title', $humanname); // XXX
template_assign('title', $displayname); // XXX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waarom staat daar nog steeds XXX? (Zie issue #16).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omdat echte porno in Duitsland hosten blijkbaar onverstandig is ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dus een htmlentities($displayname) zou genoeg zijn om die bug op te lossen?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik weet echt niet meer waar die XXX voor was. Misschien inderdaad htmlentities..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misschien weet @bwesterb dat wel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik denk dat die XXX erover gaat dat het volledige pad naar de foto in de titel zou mogen staan, in plaats van alleen het huidige item (dus met album etc. erbij).
Daarnaast gaat het niet over htmlentities(), omdat dat in het template al gebeurt.

template_assign('id');
template_assign('visibility');
template_assign('humanname');
template_assign('displayname');

// Paging
$url = './?album='. urlencode($album) . $extra_params;
Expand Down
2 changes: 1 addition & 1 deletion templates/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<?PHP } ?>
<ul>
<?PHP foreach($parentalbums as $pa) { ?>
<li><a href="./?album=<?= urlencode($pa['path'] . $pa['name']); ?>"><?= htmlentities($pa['humanname']); ?></a></li>
<li><a href="./?album=<?= urlencode($pa['path'] . $pa['name']); ?>"><?= htmlentities($pa['humanname'] ?: $pa['name']); ?></a></li>
<?PHP } ?>
</ul>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions templates/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a class="prev invalid" href="#">&laquo; Vorige</a>
<?PHP } ?>
</td>
<td class="name"><?= htmlentities($humanname); ?></td>
<td class="name"><?= htmlentities($displayname); ?></td>
<td class="next">
<?PHP if($last > $page) { ?>
<a class="next" href="<?= $url ?>&page=<?= $page + 1 ?>">Volgende &raquo;</a>
Expand All @@ -23,7 +23,7 @@
<?PHP foreach(array_chunk($albums, $thumbs_per_row) as $row) { ?>
<tr>
<?PHP foreach($row as $album) { ?>
<td class="album" width="<?= floor(100/$thumbs_per_row); ?>%"><a href=".?album=<?= urlencode($album['fullpath']) ?>"><img src="thumbnail.php?foto=<?= urlencode($album['fullpath']) ?>"><?= htmlentities($album['humanname']) ?>/</a></td>
<td class="album" width="<?= floor(100/$thumbs_per_row); ?>%"><a href=".?album=<?= urlencode($album['fullpath']) ?>"><img src="thumbnail.php?foto=<?= urlencode($album['fullpath']) ?>"><?= htmlentities($album['displayname']) ?>/</a></td>
<?PHP } ?>
</tr>
<?PHP } ?>
Expand Down