Permalink
Browse files

Redirect to page not found if we get random 2arg path urls (should be…

… a video)

Use explicit links in the admin buckets html
  • Loading branch information...
1 parent 15ee083 commit d7bf56a48968c4a85b6556c91aadbee67ae56bde Unknown committed Sep 22, 2012
Showing with 6 additions and 2 deletions.
  1. +4 −0 lib/PresentingPerl/Web/Controller/Root.pm
  2. +2 −2 lib/PresentingPerl/Web/View/Zoom/Admin.pm
@@ -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 {
@@ -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!
@@ -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/'

0 comments on commit d7bf56a

Please sign in to comment.