Changeset 1823 for branches/release-34/lib/MT/CMS/TrackBack.pm
- Timestamp:
- 04/09/08 10:05:12 (20 months ago)
- Files:
-
- 1 modified
-
branches/release-34/lib/MT/CMS/TrackBack.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-34/lib/MT/CMS/TrackBack.pm
r1480 r1823 186 186 my $pkg = $app->model('entry'); 187 187 my $entry = $pkg->load($val); 188 $param{filter_phrase} = $app->translate( 189 "TrackBacks where <strong>[_1]</strong> is "[_2]".", 190 $entry->class_label, 191 encode_html( $entry->title ) 192 ); 188 if ($entry) { 189 $param{filter_phrase} = $app->translate( 190 "TrackBacks where <strong>[_1]</strong> is "[_2]".", 191 $entry->class_label, 192 encode_html( $entry->title ) 193 ); 194 } 193 195 } 194 196 elsif ( $filter_col eq 'category_id' ) { 195 197 my $pkg = $app->model('category'); 196 198 my $cat = $pkg->load($val); 197 $param{filter_phrase} = $app->translate( 198 "TrackBacks where <strong>[_1]</strong> is "[_2]".", 199 $cat->class_label, 200 encode_html( $cat->label ) 201 ); 199 if ($cat) { 200 $param{filter_phrase} = $app->translate( 201 "TrackBacks where <strong>[_1]</strong> is "[_2]".", 202 $cat->class_label, 203 encode_html( $cat->label ) 204 ); 205 } 202 206 } 203 207 $param{filter_special} = 1; … … 343 347 require MT::Entry; 344 348 my $entry = MT::Entry->load( $tb->entry_id ); 345 return ( $entry->author_id == $app->user->id 349 return ( !$entry 350 || $entry->author_id == $app->user->id 346 351 || $perms->can_manage_feedback 347 352 || $perms->can_edit_all_posts ); … … 368 373 && ( $perms->can_edit_all_posts 369 374 || $perms->can_manage_feedback ); 370 my $p = MT::TBPing->load($id); 375 my $p = MT::TBPing->load($id) 376 or return 0; 371 377 my $tbitem = $p->parent; 372 378 if ( $tbitem->isa('MT::Entry') ) { … … 404 410 my $perms = $app->permissions; 405 411 require MT::Trackback; 406 my $tb = MT::Trackback->load( $obj->tb_id ); 412 my $tb = MT::Trackback->load( $obj->tb_id ) 413 or return 0; 407 414 if ( my $entry = $tb->entry ) { 408 415 if ( !$perms || $perms->blog_id != $entry->blog_id ) { … … 439 446 return 1 unless $perms->can_publish_post || $perms->can_edit_categories; 440 447 require MT::Trackback; 441 my $tb = MT::Trackback->load( $obj->tb_id ); 448 my $tb = MT::Trackback->load( $obj->tb_id ) 449 or return 0; 442 450 if ($tb) { 443 451 if ( $tb->entry_id ) { … … 445 453 my $entry = MT::Entry->load( $tb->entry_id ); 446 454 return 1 447 unless ( $entry->author_id == $app->user->id )455 if ( !$entry || $entry->author_id != $app->user->id ) 448 456 && $perms->can_publish_post; 449 457 }
