the usual undefined variables

This commit is contained in:
Kareila 2022-10-21 22:34:32 +00:00
parent 73b5708868
commit a536110e45
3 changed files with 7 additions and 4 deletions

View File

@ -54,8 +54,11 @@ sub embedcontent_handler {
unless $r->header_in("Host") =~ /.*$LJ::EMBED_MODULE_DOMAIN$/i;
# we should have three GET params: journalid, moduleid, auth_token
my $get = $r->get_args;
my $journalid = $get->{journalid} + 0 or return $print->("No journalid specified");
my $get = $r->get_args;
my $journalid = $get->{journalid};
return $print->("No journalid specified") unless defined $journalid;
$journalid += 0;
my $moduleid = $get->{moduleid};
return $print->("No module id specified") unless defined $moduleid;

View File

@ -505,7 +505,7 @@ sub alloc_global_counter {
# pick maximum id from sitekeywords & interests
my $max_sitekeys = $dbh->selectrow_array("SELECT MAX(kwid) FROM sitekeywords");
my $max_interests = $dbh->selectrow_array("SELECT MAX(intid) FROM interests");
$newmax = $max_sitekeys > $max_interests ? $max_sitekeys : $max_interests;
$newmax = ( $max_sitekeys // 0 ) > ( $max_interests // 0 ) ? $max_sitekeys : $max_interests;
}
elsif ( $dom eq 'I' ) {

View File

@ -659,7 +659,7 @@ qq {<div class="lj_embedcontent-wrapper" style="$wrapper_style"><div class="lj_e
# tag and it's whitelisted video.
my $r = DW::Request->get;
my $view = $r ? $r->note("view") : '';
if ( !$placeholder_prop && $view eq 'friends' ) {
if ( !$placeholder_prop && $view && $view eq 'friends' ) {
# show placeholder if this is not whitelisted video
$do_placeholder = 1 if $no_whitelist;