diffs (730 lines):

diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm       Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Entry.pm       Thu Jan 21 15:19:12 2010 +0000
@@ -1963,7 +1963,7 @@ sub reject_entry_as_spam {
         undef, $journalu->{'userid'}, $modid);
 
     use Storable;
-    my $req = Storable::thaw($frozen) if $frozen;
+    my $req = $frozen ? Storable::thaw($frozen) : undef;
 
     my ($subject, $body) = ($req->{subject}, $req->{event});
     return 0 unless $body;
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Lang.pm
--- a/cgi-bin/LJ/Lang.pm        Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Lang.pm        Thu Jan 21 15:19:12 2010 +0000
@@ -636,7 +636,7 @@ sub get_text_multi
     my %memkeys; 
     foreach my $code (keys %lc_codes) {
         my $cache_key = "ml.${lang}.${dmid}.${code}";
-        my $text = $TXT_CACHE{$cache_key} unless $LJ::NO_ML_CACHE;
+        my $text = $LJ::NO_ML_CACHE ? undef : $TXT_CACHE{$cache_key};
         
         if (defined $text) {
             $strings{ $lc_codes{$code} } = $text;
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Message.pm
--- a/cgi-bin/LJ/Message.pm     Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Message.pm     Thu Jan 21 15:19:12 2010 +0000
@@ -97,8 +97,10 @@ sub save_to_db {
     my $same_cluster = $orig_u->clusterid eq $rcpt_u->clusterid;
 
     # Begin DB Transaction
-    my $o_rv = $orig_u->begin_work;
-    my $r_rv = $rcpt_u->begin_work unless $same_cluster;
+    my ( $o_rv, $r_rv );
+    $o_rv = $orig_u->begin_work;
+    $r_rv = $rcpt_u->begin_work
+        unless $same_cluster;
 
     # Write to DB
     my $rcpt_write = $self->_save_recipient_message;
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm  Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/S2.pm  Thu Jan 21 15:19:12 2010 +0000
@@ -1969,7 +1969,8 @@ sub Entry_from_entryobj
     # comment information
     my $permalink = $entry_obj->url;
     my $replycount = $entry_obj->reply_count;
-    my $nc = "nc=$replycount" if $replycount && $remote && $remote->prop( 
'opt_nctalklinks' );
+    my $nc;
+    $nc = "nc=$replycount" if $replycount && $remote && $remote->prop( 
'opt_nctalklinks' );
     my $readurl = LJ::Talk::talkargs( $permalink, $nc, $style_args );
     my $posturl = LJ::Talk::talkargs( $permalink, 'mode=reply', $style_args );
 
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/S2/RecentPage.pm
--- a/cgi-bin/LJ/S2/RecentPage.pm       Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/S2/RecentPage.pm       Thu Jan 21 15:19:12 2010 +0000
@@ -120,7 +120,8 @@ sub RecentPage
 
     # prepare sticky entry for S2 - only show sticky entry on first page of 
Recent Entries, not on skip= pages
     # or tag and security subfilters
-    my $stickyentry = $u->get_sticky_entry
+    my $stickyentry;
+    $stickyentry = $u->get_sticky_entry
         if $skip == 0 && ! $opts->{securityfilter} && ! $opts->{tagids};
     # only show if visible to user
     if ( $stickyentry && $stickyentry->visible_to( $remote, $get->{viewall} ) 
) {
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/S2Theme.pm
--- a/cgi-bin/LJ/S2Theme.pm     Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/S2Theme.pm     Thu Jan 21 15:19:12 2010 +0000
@@ -598,7 +598,7 @@ sub get_preview_styleid {
 
     # get the styleid of the _for_preview style
     my $styleid = $u->prop('theme_preview_styleid');
-    my $style = LJ::S2::load_style($styleid) if $styleid;
+    my $style = $styleid ? LJ::S2::load_style( $styleid ) : undef;
     if (!$styleid || !$style) {
         $styleid = LJ::S2::create_style($u, "_for_preview");
         $u->set_prop('theme_preview_styleid', $styleid);
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Setting/ImagePlaceholders.pm
--- a/cgi-bin/LJ/Setting/ImagePlaceholders.pm   Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Setting/ImagePlaceholders.pm   Thu Jan 21 15:19:12 2010 +0000
@@ -51,7 +51,8 @@ sub option {
         "0|0" => 1,
         "" => 1,
     }->{$imgplaceholders};
-    my $extra = $class->ml('setting.imageplaceholders.option.select.custom', { 
width => $maxwidth, height => $maxheight })
+    my $extra;
+    $extra = $class->ml('setting.imageplaceholders.option.select.custom', { 
width => $maxwidth, height => $maxheight })
         unless $is_stock;
 
     my @options = (
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Talk.pm
--- a/cgi-bin/LJ/Talk.pm        Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Talk.pm        Thu Jan 21 15:19:12 2010 +0000
@@ -1382,7 +1382,7 @@ sub talkform {
             }
     
             # URL: [    ]  Verify? [ ]
-            my $url_def = $form->{'oidurl'} || $oid_identity if defined 
$oid_identity;
+            my $url_def = defined $oid_identity ? $form->{'oidurl'} || 
$oid_identity : "";
 
             $ret .= "<tr valign='middle' align='left' id='oid_more'><td 
colspan='2'></td><td>";
             $ret .= "Identity URL:&nbsp;<input class='textbox' name='oidurl' 
maxlength='60' size='53' id='oidurl' value='$url_def' /> ";
@@ -1482,7 +1482,7 @@ sub talkform {
             }
 
             # URL: [    ]  Verify? [ ]
-            my $url_def = $form->{'oidurl'} || $oid_identity if defined 
$oid_identity;
+            my $url_def = defined $oid_identity ? $form->{'oidurl'} || 
$oid_identity : "";
 
             $ret .= "<tr valign='middle' align='left' id='oid_more'><td 
colspan='2'></td><td>";
             $ret .= "Identity URL:&nbsp;<input class='textbox' name='oidurl' 
maxlength='60' size='53' id='oidurl' value='$url_def' /> ";
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm        Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/User.pm        Thu Jan 21 15:19:12 2010 +0000
@@ -5881,7 +5881,7 @@ sub load_user_or_identity {
     {
         # overload the uidof memcache key to accept both display name and name
         my $uid = LJ::MemCache::get( "uidof:$url" );
-        my $u = LJ::memcache_get_u( [ $uid, "userid:$uid" ] ) if $uid;
+        my $u = $uid ? LJ::memcache_get_u( [ $uid, "userid:$uid" ] ) : undef;
         return _set_u_req_cache( $u ) if $u;
     }
 
@@ -5889,7 +5889,7 @@ sub load_user_or_identity {
     my $uid = $dbh->selectrow_array("SELECT userid FROM identitymap WHERE 
idtype=? AND identity=?",
                                     undef, 'O', $url);
 
-    my $u = LJ::load_userid($uid) if $uid;
+    my $u = $uid ? LJ::load_userid($uid) : undef;
 
     # set user in memcache
     if ( $u ) {
@@ -8009,7 +8009,7 @@ sub get_daycounts
     if ($remote) {
         # do they have the viewall priv?
         my $r = eval { Apache->request; }; # web context
-        my %getargs = $r->args if $r;
+        my %getargs = $r ? $r->args : undef;
         if ( defined $getargs{'viewall'} and $getargs{'viewall'} eq '1' and ( 
$remote && $remote->has_priv( 'canview', '*' ) ) ) {
             $viewall = 1;
             LJ::statushistory_add( $u->userid, $remote->userid,
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Widget.pm
--- a/cgi-bin/LJ/Widget.pm      Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Widget.pm      Thu Jan 21 15:19:12 2010 +0000
@@ -64,7 +64,7 @@ sub start_form {
     if ($class->authas) {
         my $u = $opts{authas} || $BMLCodeBlock::GET{authas} || 
$BMLCodeBlock::POST{authas};
         $u = LJ::load_user($u) unless LJ::isu($u);
-        my $authas = $u->user if LJ::isu($u);
+        my $authas = LJ::isu($u) ? $u->user : undef;
 
         if ($authas && !$LJ::REQ_GLOBAL{widget_authas_form}) {
             $ret .= $class->html_hidden({ name => "authas", value => $authas, 
id => "_widget_authas" });
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Widget/CreateAccountTheme.pm
--- a/cgi-bin/LJ/Widget/CreateAccountTheme.pm   Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Widget/CreateAccountTheme.pm   Thu Jan 21 15:19:12 2010 +0000
@@ -39,7 +39,8 @@ sub render_body {
         $image_class =~ s/\//_/;
         my $name = $theme->name . ", " . $theme->layout_name;
 
-        my @checked = ( checked => "checked" ) if $current_theme->uniq eq 
$uniq;
+        my @checked;
+        @checked = ( checked => "checked" ) if $current_theme->uniq eq $uniq;
 
         $ret .= "<tr>" if $count % 3 == 0;
         $ret .= "<td class='theme-box'>";
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Widget/Location.pm
--- a/cgi-bin/LJ/Widget/Location.pm     Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Widget/Location.pm     Thu Jan 21 15:19:12 2010 +0000
@@ -57,8 +57,7 @@ sub render_body {
     # check if specified country has regions
     my $regions_cfg = $class->country_regions_cfg($effective_country);
     # hashref of all regions for the specified country; it is initialized and 
used only if $regions_cfg is defined, i.e. the country has regions (states)
-    my $state_options = $class->region_options($regions_cfg)
-        if $regions_cfg;
+    my $state_options = $regions_cfg ? $class->region_options($regions_cfg) : 
undef;
 
 
     my $state_inline_desc = $class->ml('widget.location.fn.state.inline');
@@ -235,7 +234,8 @@ sub handle_post {
     $post->{zip} = "" if $post->{zip} eq $zip_inline_desc;
 
     # state and zip
-    my ($zipcity, $zipstate) = LJ::load_state_city_for_zip($post->{'zip'})
+    my ( $zipcity, $zipstate );
+    ( $zipcity, $zipstate ) = LJ::load_state_city_for_zip( $post->{'zip'} )
         if $post->{'country'} eq "US" && length $post->{'zip'} > 0;
 
     # country
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Widget/S2PropGroup.pm
--- a/cgi-bin/LJ/Widget/S2PropGroup.pm  Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Widget/S2PropGroup.pm  Thu Jan 21 15:19:12 2010 +0000
@@ -131,7 +131,8 @@ sub render_body {
                 next if $class->skip_prop( $props->{$prop_name}, $prop_name, 
theme => $theme, user => $u, style => $style );
 
                 unless ($header_printed) {
-                    my $prop_list_class = " first" if $subheader_counter == 1;
+                    my $prop_list_class;
+                    $prop_list_class = " first" if $subheader_counter == 1;
 
                     $ret .= "<div class='subheader subheader-modules on' 
id='subheader__modules__${subheader}'>$subheaders{$subheader}</div>";
                     $ret .= "<table cellspacing='0' 
class='prop-list$prop_list_class' id='proplist__modules__${subheader}'>";
@@ -181,7 +182,8 @@ sub render_body {
                 # need to print the header inside the foreach because we don't 
want it printed if
                 # there's no props in this group that are also in this 
subheader
                 unless ($header_printed) {
-                    my $prop_list_class = " first" if $subheader_counter == 1;
+                    my $prop_list_class;
+                    $prop_list_class = " first" if $subheader_counter == 1;
 
                     $ret .= "<div class='subheader subheader-$propgroup on' 
id='subheader__${propgroup}__${subheader}'>$subheaders{$subheader}</div>";
                     $ret .= "<table cellspacing='0' 
class='prop-list$prop_list_class' id='proplist__${propgroup}__${subheader}'>";
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/LJ/Widget/ShopCart.pm
--- a/cgi-bin/LJ/Widget/ShopCart.pm     Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/LJ/Widget/ShopCart.pm     Thu Jan 21 15:19:12 2010 +0000
@@ -106,7 +106,8 @@ sub render_body {
         $ret .= "<p>" . $class->html_submit( removeselected => $class->ml( 
'widget.shopcart.btn.removeselected' ) ) . " ";
         $ret .= $class->html_submit( discard => $class->ml( 
'widget.shopcart.btn.discard' ) ) . "</p>";
 
-        my @paypal_option = (
+        my @paypal_option;
+        @paypal_option = (
             paypal => $class->ml( 'widget.shopcart.paymentmethod.paypal' ),
             creditcardpp => $class->ml( 
'widget.shopcart.paymentmethod.creditcardpp' ),
         )
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/htmlcontrols.pl
--- a/cgi-bin/htmlcontrols.pl   Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/htmlcontrols.pl   Thu Jan 21 15:19:12 2010 +0000
@@ -166,7 +166,8 @@ sub html_select
     $ret .= ">\n";
 
     # build hashref from arrayref if multiple selected
-    my $selref = { map { $_, 1 } @{$opts->{'selected'}} }
+    my $selref;
+    $selref = { map { $_, 1 } @{$opts->{'selected'}} }
         if $opts->{'multiple'} && ref $opts->{'selected'} eq 'ARRAY';
 
     my $did_sel = 0;
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/ljemailgateway.pl
--- a/cgi-bin/ljemailgateway.pl Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/ljemailgateway.pl Thu Jan 21 15:19:12 2010 +0000
@@ -133,7 +133,8 @@ sub process {
     my $content_type = $tent->head->get('Content-type:');
     $charset = $1 if $content_type =~ /\bcharset=['\"]?(\S+?)['\"]?[\s\;]/i;
     $format = $1 if $content_type =~ /\bformat=['\"]?(\S+?)['\"]?[\s\;]/i;
-    my $delsp = $1 if $content_type =~ /\bdelsp=['\"]?(\w+?)['\"]?[\s\;]/i;
+    my $delsp;
+    $delsp = $1 if $content_type =~ /\bdelsp=['\"]?(\w+?)['\"]?[\s\;]/i;
 
     if (defined($charset) && $charset !~ /^UTF-?8$/i) { # no charset? assume 
us-ascii
         return $err->("Unknown charset encoding type. ($charset)")
@@ -212,7 +213,8 @@ sub process {
 
         # ok, parse the XML.
         my $html = $tent->bodyhandle->as_string();
-        my $xml_string = $1 if $html =~ /<!-- 
lsPictureMail-Share-\w+-comment\n(.+)\n-->/is;
+        my $xml_string;
+        $xml_string = $1 if $html =~ /<!-- 
lsPictureMail-Share-\w+-comment\n(.+)\n-->/is;
         return $err->(
             "Unable to find XML content in PictureMail message.",
           ) unless $xml_string;
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl Thu Jan 21 13:22:38 2010 +0000
+++ b/cgi-bin/weblib.pl Thu Jan 21 15:19:12 2010 +0000
@@ -955,14 +955,16 @@ sub make_qr_link
 # </LJFUNC>
 sub get_lastcomment {
     my $remote = LJ::get_remote();
-    return (undef, undef) unless $remote;
+    my ( $talkid, $jid );
 
     # Figure out their last post
-    my $memkey = [$remote->{'userid'}, "lastcomm:$remote->{'userid'}"];
-    my $memval = LJ::MemCache::get($memkey);
-    my ($jid, $talkid) = split(/:/, $memval) if $memval;
+    if ( $remote ) {
+        my $memkey = [$remote->{'userid'}, "lastcomm:$remote->{'userid'}"];
+        my $memval = LJ::MemCache::get( $memkey );
+        ( $jid, $talkid ) = split( /:/, $memval ) if $memval;
+    }
 
-    return ($talkid, $jid);
+    return ( $talkid, $jid );
 }
 
 # <LJFUNC>
@@ -3718,7 +3720,8 @@ sub statusvis_message_js {
 
     return "" unless $u->is_locked || $u->is_memorial || $u->is_readonly;
 
-    my $statusvis_full = "locked" if $u->is_locked;
+    my $statusvis_full;
+    $statusvis_full = "locked"   if $u->is_locked;
     $statusvis_full = "memorial" if $u->is_memorial;
     $statusvis_full = "readonly" if $u->is_readonly;
 
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/accountstatus.bml
--- a/htdocs/accountstatus.bml  Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/accountstatus.bml  Thu Jan 21 15:19:12 2010 +0000
@@ -160,8 +160,7 @@ body<=
     $ret .= LJ::make_authas_select($remote, { 'authas' => $GET{'authas'}, 
'showall' => 1}) . "\n";
     $ret .= "</form>\n\n";
 
-    my $getextra;
-    $getextra = "?authas=$authas" unless $authas eq $remote->{'user'};
+    my $getextra = "?authas=$authas" unless $authas eq $remote->{'user'};
     $ret .= "<form method='post' action='accountstatus$getextra'>\n";
     $ret .= LJ::form_auth();
 
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/admin/invitecodes.bml
--- a/htdocs/admin/invitecodes.bml      Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/admin/invitecodes.bml      Thu Jan 21 15:19:12 2010 +0000
@@ -61,7 +61,7 @@ sub display_codes {
 
     foreach my $code ( @codes ) {
         my $owner = $code->owner == $account->id ? $account : LJ::load_userid( 
$code->owner );
-        my $recipient = LJ::load_userid( $code->recipient ) if $code->is_used;
+        my $recipient = $code->is_used ? LJ::load_userid( $code->recipient ) : 
undef;
         $ret .= "<tr>";
         $ret .= "<td><tt>" . $code->code . "</tt></td>";
         $ret .= "<td>" . ( $owner ? $owner->ljuser_display : "" ) . "</td>";
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/admin/statushistory.bml
--- a/htdocs/admin/statushistory.bml    Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/admin/statushistory.bml    Thu Jan 21 15:19:12 2010 +0000
@@ -51,7 +51,8 @@
         push @where, "s.shtype=$qt";
     }
 
-    my $where = "WHERE " . join(" AND ", @where) . " " if @where;
+    my $where = "";
+    $where = "WHERE " . join(" AND ", @where) . " " if @where;
 
     my $orderby = 'shdate';
     foreach (qw(user admin shdate shtype notes)) {
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/changeemail.bml
--- a/htdocs/changeemail.bml    Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/changeemail.bml    Thu Jan 21 15:19:12 2010 +0000
@@ -82,8 +82,7 @@ body<=
     };
 
     if ($POST{'mode'} eq 'submit' && ($POST{'email'} || $POST{'password'})) {
-        my $password;
-        $password = $POST{'password'} unless $remote->is_identity;
+        my $password = $POST{'password'} unless $remote->is_identity;
         my $email = LJ::trim($POST{'email'});
 
         my @errors = ();
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/community/join.bml
--- a/htdocs/community/join.bml Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/community/join.bml Thu Jan 21 15:19:12 2010 +0000
@@ -118,10 +118,12 @@ body<=
         # success message -- only shows if user didn't add the community as a 
friend
         my $profile_url = $cu->profile_url;
         my $show_join_post_link = $cu->hide_join_post_link ? 0 : 1;
-        my $post_url = $LJ::SITEROOT . "/update?usejournal=" . $cu->user
+        my $post_url;
+        $post_url = $LJ::SITEROOT . "/update?usejournal=" . $cu->user
             if $show_join_post_link && $remote->can_post_to( $cu );
         my $posting_guidelines_entry = $cu->get_posting_guidelines_entry;
-        my $posting_guidelines_entry_url = $posting_guidelines_entry->url
+        my $posting_guidelines_entry_url;
+        $posting_guidelines_entry_url = $posting_guidelines_entry->url
             if $posting_guidelines_entry;
 
         $ret .= "<?h1 $ML{'.success'} h1?><?p " . BML::ml('.label.membernow6',
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/community/members.bml
--- a/htdocs/community/members.bml      Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/community/members.bml      Thu Jan 21 15:19:12 2010 +0000
@@ -502,7 +502,7 @@ body<=
 
     # how to make links back to this page
     my $self_link = sub {
-        my $sort = "&sort=$GET{'sort'}" if $GET{'sort'};
+        my $sort = $GET{'sort'} ? "&sort=$GET{'sort'}" : "";
         return "members?authas=$cname&page=$_[0]$sort";
     };
 
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/community/moderate.bml
--- a/htdocs/community/moderate.bml     Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/community/moderate.bml     Thu Jan 21 15:19:12 2010 +0000
@@ -59,7 +59,7 @@ body<=
         my $frozen = $dbcm->selectrow_array("SELECT request_stor FROM modblob 
WHERE journalid=? AND modid=?",
                                             undef, $c->{'userid'}, $modid);
 
-        my $req = Storable::thaw($frozen) if $frozen;
+        my $req = $frozen ? Storable::thaw($frozen) : undef;
         unless ($frozen && $entry && $req->{'_moderate'}->{'authcode'} && 
$req->{'_moderate'}->{'authcode'} eq $POST{'auth'}) {
             $ret .= "<?h1 $ML{'Error'} h1?><?p $ML{'.error.noentry'} p?>";
             return $ret;
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/community/sentinvites.bml
--- a/htdocs/community/sentinvites.bml  Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/community/sentinvites.bml  Thu Jan 21 15:19:12 2010 +0000
@@ -147,8 +147,9 @@ body<=
 
     # how to make links back to this page
     my $self_link = sub {
-        my $sort = "&sort=$GET{'sort'}" if $GET{'sort'};
-        my $filter = "&show=$GET{'show'}" if $GET{'show'};
+        my ( $sort, $filter ) = ( "", "" );
+        $sort = "&sort=$GET{'sort'}" if $GET{'sort'};
+        $filter = "&show=$GET{'show'}" if $GET{'show'};
         return "sentinvites?authas=$cname&page=$_[0]$sort$filter";
     };
 
@@ -178,7 +179,7 @@ body<=
     $showlinks .= LJ::html_submit( undef, $ML{'.filterto.btn.refresh'} );
     $showlinks .= "</form>";
 
-    my $filter = "&show=$GET{show}" if $GET{show};
+    my $filter = $GET{show} ? "&show=$GET{show}" : "";
     my $sortlink = BML::get_uri() . "?authas=$cname$filter&sort=";
     $ret .= "<br /><div align='center'>$showlinks";
     $ret .= <<END; 
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/create.bml
--- a/htdocs/create.bml Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/create.bml Thu Jan 21 15:19:12 2010 +0000
@@ -27,8 +27,7 @@ body<=
     push @getargs, "from=$GET{from}" if $GET{from};
     push @getargs, "user=$GET{user}" if $GET{user};
     push @getargs, "code=$GET{code}" if $GET{code};
-    my $getextra; 
-    $getextra = '?' . join( '&', @getargs ) if @getargs;
+    my $getextra = '?' . join( '&', @getargs ) if @getargs;
 
     if ( $LJ::USE_SSL && !$LJ::IS_SSL && $GET{ssl} ne 'no' ) {
         return BML::redirect( "$LJ::SSLROOT/create$getextra" );
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/customize/advanced/layeredit.bml
--- a/htdocs/customize/advanced/layeredit.bml   Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/customize/advanced/layeredit.bml   Thu Jan 21 15:19:12 2010 +0000
@@ -9,7 +9,8 @@
     };
 
     # we need a valid id
-    my $id = $GET{'id'} if $GET{'id'} =~ /^\d+$/;
+    my $id;
+    $id = $GET{'id'} if $GET{'id'} =~ /^\d+$/;
     return $err->("You have not specified a layer to edit.")
         unless $id;
 
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/customize/advanced/layers.bml
--- a/htdocs/customize/advanced/layers.bml      Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/customize/advanced/layers.bml      Thu Jan 21 15:19:12 2010 +0000
@@ -28,7 +28,8 @@
     };
 
     # id is optional
-    my $id = $POST{'id'} if $POST{'id'} =~ /^\d+$/;
+    my $id;
+    $id = $POST{'id'} if $POST{'id'} =~ /^\d+$/;
 
     # this catches core_hidden if it's set
     $POST{'parid'} ||= $POST{'parid_hidden'};
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/editjournal.bml
--- a/htdocs/editjournal.bml    Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/editjournal.bml    Thu Jan 21 15:19:12 2010 +0000
@@ -19,8 +19,7 @@ body<=
     if ($GET{'itemid'} || $POST{'itemid'}) { $mode = "edit"; }
 
     my $ret;
-    my $getextra;
-    $getextra = "?authas=$GET{'authas'}" if $GET{'authas'};
+    my $getextra = "?authas=$GET{'authas'}" if $GET{'authas'};
 
     LJ::need_res('stc/entry.css', 'js/inputcomplete.js');
     
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/editpics.bml
--- a/htdocs/editpics.bml       Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/editpics.bml       Thu Jan 21 15:19:12 2010 +0000
@@ -301,8 +301,7 @@ use strict;
         # redirect back to ourselves
         $returl = LJ::CleanHTML::canonical_url($POST{'ret'});
         if ($returl) {
-            my $redir_host;
-            $redir_host = $1 if $returl =~ m!^http://([\.:\w-]+)!i;
+            my $redir_host = $1 if $returl =~ m!^http://([\.:\w-]+)!i;
             return BML::redirect($returl) if 
$LJ::REDIRECT_ALLOWED{$redir_host};
         }
     }
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/export_do.bml
--- a/htdocs/export_do.bml      Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/export_do.bml      Thu Jan 21 15:19:12 2010 +0000
@@ -138,8 +138,7 @@
                     $e->{'current_music'} = $eprops->{'current_music'};
                     $e->{'current_mood'} = $eprops->{'current_mood'};
                     if ($eprops->{'current_moodid'}) {
-                        my $mood;
-                        $mood = LJ::mood_name($eprops->{'current_moodid'})
+                        my $mood = LJ::mood_name($eprops->{'current_moodid'})
                             if $eprops->{'current_moodid'};
                         $e->{'current_mood'} = $mood if $mood;
                     }
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/login.bml
--- a/htdocs/login.bml  Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/login.bml  Thu Jan 21 15:19:12 2010 +0000
@@ -61,8 +61,7 @@
 
         # Redirect to offsite uri if allowed, and not an internal LJ redirect. 
('ret' == 1)
         if ($POST{ret} && $POST{ret} != 1) {
-            my $redir_host;
-            $redir_host = $1 if $POST{ret} =~ m#^http://([\.:\w-]+)#i;
+            my $redir_host = $1 if $POST{ret} =~ m#^http://([\.:\w-]+)#i;
         
             if ($LJ::REDIRECT_ALLOWED{$redir_host} || $redir_host eq 
$LJ::DOMAIN_WEB) {
                 LJ::Hooks::run_hook('login_redirect_extra', $redir_host);
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/logout.bml
--- a/htdocs/logout.bml Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/logout.bml Thu Jan 21 15:19:12 2010 +0000
@@ -39,8 +39,7 @@
             return;
         }
 
-        my $cursess;
-        $cursess = $u->session if $u;
+        my $cursess = $u->session if $u;
 
         if ($cursess &&
             $user eq $u->{'user'} &&
@@ -58,8 +57,7 @@
 
             # Redirect to offsite uri if allowed.
             if ($POST{'ret'}) {
-                my $redir_host;
-                $redir_host = $1 if $POST{'ret'} =~ m#^http://([\.:\w-]+)#i;
+                my $redir_host = $1 if $POST{'ret'} =~ m#^http://([\.:\w-]+)#i;
                 return BML::redirect($POST{'ret'}) if 
$LJ::REDIRECT_ALLOWED{$redir_host};
             }
 
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/manage/pubkey.bml
--- a/htdocs/manage/pubkey.bml  Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/manage/pubkey.bml  Thu Jan 21 15:19:12 2010 +0000
@@ -22,12 +22,14 @@ body<=
 
         # make sure it is a public key, not a private or a signature,
         # before we bother with other checks
-        my $kt = $1 if $key =~ /-{5}BEGIN PGP (\w+) /;
+        my $kt;
+        $kt = $1 if $key =~ /-{5}BEGIN PGP (\w+) /;
         return 0 unless $kt eq 'PUBLIC';
 
         # pull key data, return if suspicious
         my $ks = "$kt KEY BLOCK";
-        my $data = $1 if $key =~ /$ks-{5}(.+?)-{5}.+?$ks(?:-)+/s;
+        my $data;
+        $data = $1 if $key =~ /$ks-{5}(.+?)-{5}.+?$ks(?:-)+/s;
         foreach ($data =~ /^(\w+):/mg) {
             return 0 unless $1 =~ /(Version|Hash|Comment|MessageID|Charset)/i;
         }
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/manage/settings/index.bml
--- a/htdocs/manage/settings/index.bml  Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/manage/settings/index.bml  Thu Jan 21 15:19:12 2010 +0000
@@ -381,7 +381,7 @@ body<=
         if ($cats_with_settings{$cat}->{disabled}) {
             $ret .= "<li 
class='disabled'>$cats_with_settings{$cat}->{name}</li>";
         } else {
-            my $active_class = " class='active'" if $cat eq $given_cat;
+            my $active_class = $cat eq $given_cat ? " class='active'" : "";
             $ret .= "<li><a 
href='$LJ::SITEROOT/manage/settings/$getextra${getsep}cat=$cat'$active_class>$cats_with_settings{$cat}->{name}</a></li>";
         }
     }
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/misc/latestqotd.bml
--- a/htdocs/misc/latestqotd.bml        Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/misc/latestqotd.bml        Thu Jan 21 15:19:12 2010 +0000
@@ -12,7 +12,7 @@ body<=
     my $ret;
 
     my $qid = $GET{qid}+0;
-    my $qotd = LJ::QotD->get_single_question($qid) if $qid;
+    my $qotd = $qid ? LJ::QotD->get_single_question($qid) : undef;
 
     $ret .= "<table width='100%' cellspacing='5' cellpadding='0'><tr><td 
valign='top'>";
     $ret .= LJ::Widget::QotDResponses->render;
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/preview/entry.bml
--- a/htdocs/preview/entry.bml  Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/preview/entry.bml  Thu Jan 21 15:19:12 2010 +0000
@@ -61,7 +61,8 @@
 
                 # check whether to use custom comment pages
                 $ctx = LJ::S2::s2_context( $u->{s2_style} );
-                my $view_entry_disabled = ! 
$ctx->[S2::PROPS]->{use_journalstyle_entry_page} if $ctx;
+                my $view_entry_disabled;
+                $view_entry_disabled = ! 
$ctx->[S2::PROPS]->{use_journalstyle_entry_page} if $ctx;
             
                 return (2, $u->{'s2_style'}) unless $forceflag || 
$view_entry_disabled;
             }
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/settings/index.bml
--- a/htdocs/settings/index.bml Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/settings/index.bml Thu Jan 21 15:19:12 2010 +0000
@@ -68,7 +68,8 @@
         return;
     }
 
-    my $returns = LJ::Setting::save_all($u, \%POST, \...@matches)
+    my $returns;
+    $returns = LJ::Setting::save_all( $u, \%POST, \...@matches )
         if LJ::did_post();
 
     $body .= "<form method='get' action='./'>\n";
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/support/faqbrowse.bml
--- a/htdocs/support/faqbrowse.bml      Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/support/faqbrowse.bml      Thu Jan 21 15:19:12 2010 +0000
@@ -193,7 +193,7 @@ body<=
             $$body .= "<br />";
 
             unless ( $display_answer ) {
-                my $q = "&amp;q=" . LJ::eurl($qterm) if $qterm;
+                my $q = $qterm ? "&amp;q=" . LJ::eurl($qterm) : "";
 
                 $$body .= "<div id='rm' name='rm'>";
                 my $oc = $faqcatarg ? '' : "onclick='return showAnswer();'";
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/support/history.bml
--- a/htdocs/support/history.bml        Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/support/history.bml        Thu Jan 21 15:19:12 2010 +0000
@@ -67,7 +67,7 @@ body<=
                 };
                 push @userids, $row->[4] if $row->[4];
             }
-            my $us = LJ::load_userids(@userids) if @userids;
+            my $us = @userids ? LJ::load_userids(@userids) : undef;
 
             # get categories
             my $cats = LJ::Support::load_cats();
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/support/see_request.bml
--- a/htdocs/support/see_request.bml    Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/support/see_request.bml    Thu Jan 21 15:19:12 2010 +0000
@@ -335,7 +335,7 @@ body<=
                     "$ename <a href=\"history?user=$u->{user}\">" . 
LJ::ehtml($u->{name}) . "</a>" :
                     "$ename";
 
-            my $email_string = " ($visemail)" if $has_vs || $has_sh;
+            my $email_string = $has_vs || $has_sh ? " ($visemail)" : "";
             $email_string = " (<a href=\"history?email=" . LJ::eurl($email) . 
"\">$email</a>)" if $show_history{email};
             $ret .= $email_string;
         } else {
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/update.bml
--- a/htdocs/update.bml Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/update.bml Thu Jan 21 15:19:12 2010 +0000
@@ -103,8 +103,7 @@
 
     # if a QotD id was passed in, fill in the fields with that QotD
     my $qid = $GET{qotd}+0;
-    my $qotd;
-    $qotd = LJ::QotD->get_single_question($qid) if $qid;
+    my $qotd = LJ::QotD->get_single_question($qid) if $qid;
     if ($qotd) {
         $subject = LJ::Widget::QotD->subject_text($qotd, user => $remote);
         $event = LJ::Widget::QotD->embed_text($qotd);
diff -r e4a5fc6f26b1 -r 3b8be241a7b5 htdocs/userinfo.bml
--- a/htdocs/userinfo.bml       Thu Jan 21 13:22:38 2010 +0000
+++ b/htdocs/userinfo.bml       Thu Jan 21 15:19:12 2010 +0000
@@ -361,8 +361,7 @@ body<=
     my $title = $u->prop( "journaltitle" ) ?
                     LJ::ehtml( $u->prop( "journaltitle" ) ) :
                     BML::ml( '.details.title', { user => $u->display_username 
} );
-    my $subtitle;
-    $subtitle = LJ::ehtml( $u->prop( "journalsubtitle" ) )
+    my $subtitle = LJ::ehtml( $u->prop( "journalsubtitle" ) )
         if $u->prop( "journalsubtitle" );
 
     $ret .= qq{
@@ -383,8 +382,7 @@ body<=
     # account type
     my $accttype = DW::Pay::get_account_type_name( $u );
     if ( $accttype ) {
-        my $expiretime;
-        $expiretime = DW::Pay::get_account_expiration_time( $u )
+        my $expiretime = DW::Pay::get_account_expiration_time( $u )
             if $remote && $remote->can_manage( $u );
 
         $ret .= "<p>";
@@ -444,8 +442,7 @@ body<=
     };
 
     if ( $bibody ) {
-        my $links;
-        $links = [ { url => "$LJ::SITEROOT/manage/profile/?authas=" . 
$u->user, text => $ML{'.section.edit'} } ]
+        my $links = [ { url => "$LJ::SITEROOT/manage/profile/?authas=" . 
$u->user, text => $ML{'.section.edit'} } ]
             if $remote && $remote->can_manage( $u );
         $ret .= $content_block->(
             section_name    => 'basics',
@@ -499,8 +496,7 @@ body<=
     $biobody .= $profile->bio;
 
     if ( $biobody ) {
-        my $links;
-        $links = [ { url => "$LJ::SITEROOT/manage/profile/?authas=" . $u->user 
. "#bio", text => $ML{'.section.edit'} } ]
+        my $links = [ { url => "$LJ::SITEROOT/manage/profile/?authas=" . 
$u->user . "#bio", text => $ML{'.section.edit'} } ]
             if $remote && $remote->can_manage( $u );
         $ret .= $content_block->(
             section_name    => 'bio',
@@ -566,11 +562,9 @@ body<=
         $imlist .= "</tr>"; 
     }
     if ( $imlist ) {
-        my $new_im_margin;
-        $new_im_margin = " style='margin-top: 0;'" unless $intlist;
+        my $new_im_margin = " style='margin-top: 0;'" unless $intlist;
         $connectbody .= qq{ <div class="external_services"$new_im_margin> };
-        my $links;
-        $links = [ { url => "$LJ::SITEROOT/manage/profile/?authas=" . $u->user 
. "#iminfo", text => $ML{'.section.edit'} } ]
+        my $links = [ { url => "$LJ::SITEROOT/manage/profile/?authas=" . 
$u->user . "#iminfo", text => $ML{'.section.edit'} } ]
             if $remote && $remote->can_manage( $u );
         $connectbody .= $content_inner_block->(
             section_name_ml => '.im.header2',
@@ -622,8 +616,7 @@ body<=
         }
 
         if ( $maintbody || $modbody ) {
-            my $links;
-            $links = [ { url => "$LJ::SITEROOT/community/members?authas=" . 
$u->user, text => $ML{'.section.edit'} } ]
+            my $links = [ { url => "$LJ::SITEROOT/community/members?authas=" . 
$u->user, text => $ML{'.section.edit'} } ]
                 if $remote && $remote->can_manage( $u );
             $ret .= $content_block->(
                 section_name    => 'admins',
@@ -669,11 +662,10 @@ body<=
             ( $u->prop( 'opt_hidefriendofs' ) && ( !$remote || 
!$remote->can_manage( $u ) ) );
     }
 
-    my ( @members_userids, @member_of_userids, @posting_access_to_userids, 
@posting_access_from_userids );
-    @members_userids = $u->member_userids if $u->is_community;
-    @member_of_userids = $u->member_of_userids if $u->is_personal;
-    @posting_access_to_userids = @{LJ::load_rel_target( $u, 'P' )} if 
$u->is_personal;
-    @posting_access_from_userids = @{LJ::load_rel_user( $u, 'P' )} if 
$u->is_community;
+    my @members_userids = $u->member_userids if $u->is_community;
+    my @member_of_userids = $u->member_of_userids if $u->is_personal;
+    my @posting_access_to_userids = @{LJ::load_rel_target( $u, 'P' )} if 
$u->is_personal;
+    my @posting_access_from_userids = @{LJ::load_rel_user( $u, 'P' )} if 
$u->is_community;
 
     my $us = LJ::load_userids(
         @trusted_userids, @trusted_by_userids,
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to