X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FFactoids%2FUpdate.pl;h=475e0d9500b0b2acd04fef48d063f39811727936;hb=f3618054e8879cfcc83a1e0c1d3aceb83a092ed7;hp=400012e52387e126765c803dba173bf3966c8f82;hpb=b519a694346a40b6a8ddeba552df43fe6df0e113;p=infobot.git diff --git a/src/Factoids/Update.pl b/src/Factoids/Update.pl index 400012e..475e0d9 100644 --- a/src/Factoids/Update.pl +++ b/src/Factoids/Update.pl @@ -120,7 +120,23 @@ sub update { } if ($also) { # 'is also'. - if ($exists =~ /^ see /i) { + my $redircount = 5; + my $origlhs = $lhs; + while ($exists =~ /^ ?see (.*)/i) { + $redircount--; + unless ($redircount) { + &msg($who, "$origlhs has too many levels of redirection."); + return 1; + } + + $lhs = $1; + $exists = &getFactoid($lhs); + unless( $exists ) { + &msg($who, "$1 is a dangling redirection."); + return 1; + } + } + if ($exists =~ /^ ?see (.*)/i) { &TODO("Update.pl: append to linked factoid."); }