Skip to content

Commit

Permalink
Redirect to page not found if we get random 2arg path urls (should be…
Browse files Browse the repository at this point in the history
… a video)

Use explicit links in the admin buckets html
  • Loading branch information
Unknown committed Sep 22, 2012
1 parent 15ee083 commit d7bf56a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/PresentingPerl/Web/Controller/Root.pm
Expand Up @@ -62,6 +62,10 @@ sub video :Path :Args(2) {
my ($self, $c, $bucket, $video) = @_;

my $videorow = $c->model('DB::Video')->find({ slug => $video });
if(!$videorow) {
$c->debug("Can't find a videorow for $video");
return $c->forward('default');
}
my $video_file = first {
-e join('/', $c->path_to('root/static'), $_)
} map {
Expand Down
4 changes: 2 additions & 2 deletions lib/PresentingPerl/Web/View/Zoom/Admin.pm
Expand Up @@ -11,7 +11,7 @@ sub wrap {

$zoom->select('#main-content')->collect_content({into => \@body})->run;

print STDERR Dumper(\@body);
# print STDERR Dumper(\@body);

my $layout_zoom = HTML::Zoom->from_file($stash->{wrapper_template});
# This does *not* modify $layout_zoom, but rather returns the modified version!
Expand All @@ -29,7 +29,7 @@ sub all_buckets {
$_->select('.bucket-slug')->replace_content($obj->slug)
->select('.bucket-name')->replace_content($obj->name)
->select('.edit-link')->set_attribute(
'href' => 'buckets/' . $obj->slug.'/'
'href' => '/admin/buckets/' . $obj->slug.'/'
)
->select('.delete-link')->set_attribute(
'href' => $obj->slug.'/delete/'
Expand Down

0 comments on commit d7bf56a

Please sign in to comment.