| | 342 | sub validping_check { |
|---|
| | 343 | my ($eh, $app, $obj, $data) = @_; |
|---|
| | 344 | |
|---|
| | 345 | require MT::Trackback; |
|---|
| | 346 | my $tb = MT::Trackback->load( $obj->tb_id ); |
|---|
| | 347 | if (!$tb) { |
|---|
| | 348 | # this is merely a redundant assertion since MT does this |
|---|
| | 349 | # check for us. |
|---|
| | 350 | return BLOCK; |
|---|
| | 351 | } |
|---|
| | 352 | |
|---|
| | 353 | if ($tb->entry_id) { |
|---|
| | 354 | my $entry = MT::Entry->load($tb->entry_id); |
|---|
| | 355 | if ($entry && !$entry->allow_pings) { |
|---|
| | 356 | $eh->error("Blocking ".$data->{__type}." on blog id ".$obj->blog_id." for entry id ".$tb->entry_id." since it no longer allows pings."); |
|---|
| | 357 | return BLOCK; |
|---|
| | 358 | } |
|---|
| | 359 | } elsif ($tb->category_id) { |
|---|
| | 360 | my $cat = MT::Category->load($tb->category_id); |
|---|
| | 361 | if ($cat && !$cat->allow_pings) { |
|---|
| | 362 | $eh->error("Blocking ".$data->{__type}." on blog id ".$obj->blog_id." for category id ".$tb->category_id." since it no longer allows pings."); |
|---|
| | 363 | return BLOCK; |
|---|
| | 364 | } |
|---|
| | 365 | } |
|---|
| | 366 | IGNORE; |
|---|
| | 367 | } |
|---|
| | 368 | |
|---|