fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-11-17 07:16 am

[dw-free] Warnings when loading a comment/reply page in site skin

[commit: http://hg.dwscoalition.org/dw-free/rev/d6718902899b]

http://bugs.dwscoalition.org/show_bug.cgi?id=3236

Another tweak; $form isn't a plain hash.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Talk.pm
--------------------------------------------------------------------------------
diff -r 624bda6a8380 -r d6718902899b cgi-bin/LJ/Talk.pm
--- a/cgi-bin/LJ/Talk.pm	Wed Nov 17 14:56:53 2010 +0800
+++ b/cgi-bin/LJ/Talk.pm	Wed Nov 17 15:16:34 2010 +0800
@@ -1306,8 +1306,6 @@ sub talkform {
     my $pics = LJ::Talk::get_subjecticons();
     my $entry = LJ::Entry->new( $journalu, ditemid => $opts->{ditemid} );
 
-    $form->{$_} ||= "" foreach qw( usertype userpost cookieuser );
-
     # once we clean out talkpost.bml, this will need to be changed.
     BML::set_language_scope('/talkpost.bml');
 
@@ -1370,26 +1368,26 @@ sub talkform {
 
         # Initial page load (no remote)
         return $default if $type eq 'anonymous' &&
-            ! $form->{'usertype'} && ! $remote && ! $oid_identity;
+            ! $form->{usertype} && ! $remote && ! $oid_identity;
 
         # Anonymous
         return $default if $type eq 'anonymous' &&
-            $form->{'usertype'} eq 'anonymous';
+            $form->{usertype} && $form->{usertype} eq 'anonymous';
 
         if (LJ::OpenID->consumer_enabled) {
             # OpenID
             return $default if $type eq 'openid' &&
-                $form->{'usertype'} eq 'openid';
+                $form->{usertype} && $form->{usertype} eq 'openid';
 
             return $default if $type eq 'openid_cookie' &&
-                ($form->{'usertype'} eq 'openid_cookie' ||
-                (defined $oid_identity));
+                ( $form->{usertype} && $form->{usertype} eq 'openid_cookie' ||
+                ( defined $oid_identity ) );
         }
 
         # Remote user, remote equals userpost
         return $default if $type eq 'remote' &&
-                           ($form->{'usertype'} eq 'cookieuser' ||
-                            $form->{'userpost'} eq $form->{'cookieuser'});
+                           ( ( $form->{usertype} || "" ) eq 'cookieuser' ||
+                             ( $form->{userpost} || "" ) eq ( $form->{cookieuser} || "" ) );
 
         # Possible remote, using ljuser field
         if ( $type eq 'ljuser' ) {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org