Skip to content

Commit

Permalink
Using SafeString in album controller / view
Browse files Browse the repository at this point in the history
  • Loading branch information
andyst committed Aug 29, 2009
1 parent 2d63348 commit a2e2a21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions modules/gallery/controllers/albums.php
Expand Up @@ -112,7 +112,7 @@ private function _create_album($album) {
log::success("content", "Created an album",
html::anchor("albums/$new_album->id", "view album"));
message::success(
t("Created album %album_title", array("album_title" => p::clean($new_album->title))));
t("Created album %album_title", array("album_title" => $new_album->title)));

print json_encode(
array("result" => "success",
Expand Down Expand Up @@ -145,7 +145,7 @@ private function _create_photo($album) {

log::success("content", "Added a photo", html::anchor("photos/$photo->id", "view photo"));
message::success(
t("Added photo %photo_title", array("photo_title" => p::clean($photo->title))));
t("Added photo %photo_title", array("photo_title" => $photo->title)));

print json_encode(
array("result" => "success",
Expand Down Expand Up @@ -194,7 +194,7 @@ public function _update($album) {

log::success("content", "Updated album", "<a href=\"albums/$album->id\">view</a>");
message::success(
t("Saved album %album_title", array("album_title" => p::clean($album->title))));
t("Saved album %album_title", array("album_title" => $album->title)));

print json_encode(
array("result" => "success",
Expand Down
6 changes: 3 additions & 3 deletions themes/default/views/album.html.php
Expand Up @@ -2,8 +2,8 @@
<? // @todo Set hover on AlbumGrid list items for guest users ?>
<div id="gInfo">
<?= $theme->album_top() ?>
<h1><?= p::purify($item->title) ?></h1>
<div class="gDescription"><?= nl2br(p::purify($item->description)) ?></div>
<h1><?= SafeString::of($item->title)->purified_html() ?></h1>
<div class="gDescription"><?= nl2br(SafeString::of($item->description)->purified_html()) ?></div>
</div>

<ul id="gAlbumGrid">
Expand All @@ -20,7 +20,7 @@
</a>
<?= $theme->thumb_bottom($child) ?>
<?= $theme->thumb_menu($child) ?>
<h2><span></span><a href="<?= $child->url() ?>"><?= p::clean($child->title) ?></a></h2>
<h2><span></span><a href="<?= $child->url() ?>"><?= SafeString::of($child->title) ?></a></h2>
<ul class="gMetadata">
<?= $theme->thumb_info($child) ?>
</ul>
Expand Down

0 comments on commit a2e2a21

Please sign in to comment.