afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-03-14 06:38 am

[dw-free] Don't save empty sitescheme setting

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

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

Don't save empty site scheme setting.

Patch from LiveJournal, prepared for Dreamwidth by [staff profile] denise.

Files modified:
  • cgi-bin/LJ/Setting/SiteScheme.pm
--------------------------------------------------------------------------------
diff -r 415cf9038925 -r 4e1c1cb20530 cgi-bin/LJ/Setting/SiteScheme.pm
--- a/cgi-bin/LJ/Setting/SiteScheme.pm	Sat Mar 14 06:32:38 2009 +0000
+++ b/cgi-bin/LJ/Setting/SiteScheme.pm	Sat Mar 14 06:37:29 2009 +0000
@@ -61,6 +61,8 @@ sub error_check {
     my ($class, $u, $args) = @_;
     my $val = $class->get_arg($args, "sitescheme");
 
+    return 1 unless $val;
+
     my @scheme_names;
     foreach my $scheme (LJ::site_schemes()) {
         push @scheme_names, $scheme->{scheme};
@@ -77,6 +79,7 @@ sub save {
     $class->error_check($u, $args);
 
     my $val = my $cval = $class->get_arg($args, "sitescheme");
+    return 1 unless $val;
     my @bml_schemes = LJ::site_schemes();
 
     # don't set cookie for default scheme
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

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