[MTOS-dev] Trackback Bug?
Reed A. Cartwright
reed at scit.us
Sat Mar 22 13:22:28 PDT 2008
Here is some code from lib/MT/App/Trackback.pm::ping
It checks for duplicates. I'm thinking that one of the lines is wrong.
Shouldn't line 8 be "if ( $app->remote_ip *neq* $_->ip )"?
> my $ping;
>
> # Check for duplicates...
> my @pings = MT::TBPing->load( { tb_id => $tb->id } );
> foreach (@pings) {
> if ( $_->source_url eq $url ) {
> return $app->_response() if $_->is_junk;
> if ( $app->remote_ip eq $_->ip ) {
> $ping = $_;
> last;
> }
> else {
>
> # return success to quiet this pinger
> return $app->_response();
> }
> }
> }
>
> if ( !$ping ) {
> $ping ||= MT::TBPing->new;
> $ping->blog_id( $tb->blog_id );
> $ping->tb_id($tb_id);
> $ping->source_url($url);
> $ping->ip( $app->remote_ip || '' );
> $ping->junk_status(0);
> $ping->visible(1);
> }
--
*********************************************************
Reed A. Cartwright, PhD http://scit.us/
Postdoctoral Researcher http://www.dererumnatura.us/
Department of Genetics http://www.pandasthumb.org/
Bioinformatics Research Center
North Carolina State University
Campus Box 7566
Raleigh, NC 27695-7566
Cuiusvis hominis est errare, nullius nisi
insipientis in errore perserverare. --Cicero
More information about the MTOS-dev
mailing list