[dw-free] investigate datetime manipulation in talkread vs. talkpost
[commit: http://hg.dwscoalition.org/dw-free/rev/9fa9bd025481]
http://bugs.dwscoalition.org/show_bug.cgi?id=3314
Initialize variables to avoid warnings. (Also, treat $remote as user object,
not as hashref)
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3314
Initialize variables to avoid warnings. (Also, treat $remote as user object,
not as hashref)
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/LJ/Talk.pm
-------------------------------------------------------------------------------- diff -r 4182da2bdc12 -r 9fa9bd025481 cgi-bin/LJ/Talk.pm --- a/cgi-bin/LJ/Talk.pm Fri Dec 17 16:34:34 2010 +0800 +++ b/cgi-bin/LJ/Talk.pm Fri Dec 17 16:39:07 2010 +0800 @@ -1726,10 +1726,14 @@ sub talkform { my $ljuser_def = ""; if ($remote && !defined $oid_identity) { - if ($form->{userpost} ne $form->{cookieuser} && $form->{usertype} ne 'anonymous') { - $ljuser_def = BML::eall($form->{userpost}); - } else { - $ljuser_def = $remote->{user}; + my $usertype = defined $form->{usertype} ? $form->{usertype} : ''; + my $userpost = defined $form->{userpost} ? $form->{userpost} : ''; + my $cookieuser = defined $form->{cookieuser} ? $form->{cookieuser} : ''; + + if ( $userpost ne $cookieuser && $usertype ne 'anonymous' ) { + $ljuser_def = BML::eall( $form->{userpost} ); + } else { + $ljuser_def = $remote->user; } } $ljuser_def = "" unless $remote_can_comment; --------------------------------------------------------------------------------