2heoh (2heoh) wrote in changelog,
2heoh
2heoh
changelog

[livejournal] r19338: LJM-1839: Integration m.livejournal.com ...

Committer: slobin
LJM-1839: Integration m.livejournal.com into big version LiveJournal

U   branches/mobile/cgi-bin/Apache/LiveJournal.pm
Modified: branches/mobile/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- branches/mobile/cgi-bin/Apache/LiveJournal.pm	2011-06-21 10:17:10 UTC (rev 19337)
+++ branches/mobile/cgi-bin/Apache/LiveJournal.pm	2011-06-22 03:09:28 UTC (rev 19338)
@@ -342,18 +342,23 @@
     if( LJ::Request->notes('controller') ) {
         my @args = split (/\//, LJ::Request->uri);
         
-        my $responce = LJ::Request->notes('controller')->process([@args[1 .. @args-1]], LJ::Request::request->{r});
+        my $response = LJ::Request->notes('controller')->process([@args[1 .. @args-1]]);
         LJ::Request->handler("perl-script");
         LJ::Request->set_handlers(PerlHandler => sub {
+            # show error page if controller didn't return response object
+            unless($response) {
+                $response = LJ::Mob::Response::Error->new;
+            }
+
             # processing result of controller
-            my $result = eval{$responce->output};
+            my $result = eval{$response->output};
 
             return LJ::Request::OK
-                if $responce->isa('LJ::Mob::Responce::Template');
+                if $response->isa('LJ::Mob::Response::Template');
 
-            if ($responce->isa('LJ::Mob::Responce::Redirect')) {
+            if ($response->isa('LJ::Mob::Response::Redirect')) {
                 LJ::Request->send_cookies;
-                LJ::Request->redirect($responce->location);
+                LJ::Request->redirect($response->location);
                 LJ::Request->send_http_header();
                 return LJ::Request::REDIRECT;
             }

Tags: 2heoh, 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