Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r17093: LJRU-2138: Special URLs to count how man...

Committer: gariev
LJRU-2138: Special URLs to count how many people hit the link (and redirect them to their actual link)
U   trunk/cgi-bin/Apache/LiveJournal.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2010-08-06 04:20:44 UTC (rev 17092)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2010-08-06 04:54:08 UTC (rev 17093)
@@ -459,11 +459,13 @@
     ##
     if ($host eq $LJ::DOMAIN_WEB && $uri =~ m!^/redirect/!) {
         my $url = $GET{'url'};
-        $url = $LJ::SITE_ROOT 
-            unless $url 
-                    && $url =~ m! ^ https?:// [-\w.]*? ([-\w]+ \. [-\w]+) / !x 
-                    && $LJ::ALLOWED_REDIRECT_TO_DOMAIN{$1};
-        return redir($url);
+        if ($url 
+            && $url =~ m! ^ https?:// [-\w.]*? ([-\w]+ \. [-\w]+) / !x 
+            && $LJ::ALLOWED_REDIRECT_TO_DOMAIN{$1}) 
+        {
+            return redir($url);
+        }
+        ## else - returns 404
     }
 
 

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