Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r19175: LJSV-1375 (Style Reverts to Generator/Na...

Committer: ailyin
LJSV-1375 (Style Reverts to Generator/Nautical): if there is really no style, default to default; affects identities
U   trunk/cgi-bin/LJ/S2.pm
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2011-05-30 10:06:45 UTC (rev 19174)
+++ trunk/cgi-bin/LJ/S2.pm	2011-05-30 10:59:06 UTC (rev 19175)
@@ -611,6 +611,22 @@
     }
 
     my %style;
+
+    unless ($styleid) {
+        # special case here: styleid=0 is the default style, whatever
+        # it is
+
+        my $public = get_public_layers();
+        while (my ($layer, $name) = each %$LJ::DEFAULT_STYLE) {
+            next unless $name ne "";
+            next unless $public->{$name};
+            my $id = $public->{$name}->{'s2lid'};
+            $style{$layer} = $id if $id;
+        }
+
+        return %style;
+    }
+
     my $have_style = 0;
 
     if ($verify && $styleid) {
@@ -656,14 +672,6 @@
 
     unless ($have_style) {
         die "LJ::S2: style $styleid seems to be empty";
-
-        my $public = get_public_layers();
-        while (my ($layer, $name) = each %$LJ::DEFAULT_STYLE) {
-            next unless $name ne "";
-            next unless $public->{$name};
-            my $id = $public->{$name}->{'s2lid'};
-            $style{$layer} = $id if $id;
-        }
     }
 
     return %style;

Tags: andy, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments