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

[livejournal] r22227: LJSV-2253 (New Scrapbook treats users wi...

Committer: ailyin
LJSV-2253 (New Scrapbook treats users with usernames starting or ending with underscores inproperly)
U   trunk/cgi-bin/Apache/LiveJournal.pm
U   trunk/cgi-bin/LJ/Session.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2012-06-13 11:41:14 UTC (rev 22226)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2012-06-13 12:02:04 UTC (rev 22227)
@@ -1088,6 +1088,7 @@
     if ( ($LJ::USER_VHOSTS || $LJ::ONLY_USER_VHOSTS ) &&
         $host =~ /^([\w\-]{1,15})\.\Q$LJ::USER_DOMAIN\E$/ &&
         $1 ne "www" &&
+        LJ::Request->uri !~ m{^/__rpc} &&
 
         # 1xx: info, 2xx: success, 3xx: redirect, 4xx: client err, 5xx: server err
         # let the main server handle any errors
@@ -1201,7 +1202,8 @@
      && $host ne $LJ::DOMAIN_WEB
      && $host ne $LJ::DOMAIN
      && $host =~ /\./
-     && $host =~ /[^\d\.]/ )
+     && $host =~ /[^\d\.]/
+     && LJ::Request->uri !~ m{^/__rpc} )
     {
         my $u = LJ::User->new_from_external_domain($host);
         my $ru_lj_user;
@@ -1255,11 +1257,13 @@
 
     # normal (non-domain) journal view
     if (
-        $uri =~ m!
-        ^/(users\/|community\/|\~)  # users/community/tilde
-        ([^/]+)                     # potential username
-        (.*)?                       # rest
-        !x && $uri !~ /\.bml/)
+        $uri =~ m{
+            ^/(users\/|community\/|\~)  # users/community/tilde
+            ([^/]+)                     # potential username
+            (.*)?                       # rest
+        }x &&
+        $uri !~ /\.bml/ &&
+        LJ::Request->uri !~ m{^/__rpc} )
     {
         my ($part1, $user, $rest) = ($1, $2, $3);
 

Modified: trunk/cgi-bin/LJ/Session.pm
===================================================================
--- trunk/cgi-bin/LJ/Session.pm	2012-06-13 11:41:14 UTC (rev 22226)
+++ trunk/cgi-bin/LJ/Session.pm	2012-06-13 12:02:04 UTC (rev 22227)
@@ -926,20 +926,6 @@
 
         return "$LJ::SITEROOT" unless valid_destination($dest);
         return $dest unless valid_domain_cookie($domcook, $cookie, $BML::COOKIE{'ljloggedin'});
-
-        # If it is not the master domain
-
-        if ($dest =~ m!^https?://(.+?)(/.*)$!) {
-            my ($host, $url_path) = (lc($1), $2);
-            my ($subdomain, $user);
-
-            if (    $host =~ m!^([\w-\.]{1,50})\.\Q$LJ::USER_DOMAIN\E$!
-                && ($subdomain = lc($1))                                # undef: not on a user-subdomain
-                && ($LJ::SUBDOMAIN_FUNCTION{$subdomain} eq "journal")
-                && ($url_path =~ m!^/(\w{1,15})\b!) ) {
-                    $path = '/' . lc($1) . '/' if $1;
-            }
-        }
     }
 
     set_cookie(

Tags: ailyin, 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