fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-10-18 10:19 am

[dw-free] remove LJ::did_post from DW::Controller subclasses

[commit: http://hg.dwscoalition.org/dw-free/rev/2d35bfea266d]

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

Remove LJ::did_post form DW::Controller subclasses.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Controller/InviteCodes.pm
  • cgi-bin/DW/Controller/Rename.pm
  • cgi-bin/DW/Controller/Search/Interests.pm
  • cgi-bin/DW/Controller/Shop.pm
--------------------------------------------------------------------------------
diff -r 993ddcd9fc22 -r 2d35bfea266d cgi-bin/DW/Controller/InviteCodes.pm
--- a/cgi-bin/DW/Controller/InviteCodes.pm	Tue Oct 18 18:09:56 2011 +0800
+++ b/cgi-bin/DW/Controller/InviteCodes.pm	Tue Oct 18 18:19:19 2011 +0800
@@ -36,7 +36,7 @@
     my $remote = $rv->{remote};
 
     # check whether we requested more invite codes
-    if ( LJ::did_post() ) {
+    if ( $r->did_post ) {
         my $args = $r->post_args;
         return error_ml( 'error.invalidform' )
             unless LJ::check_form_auth( $args->{lj_form_auth} );
diff -r 993ddcd9fc22 -r 2d35bfea266d cgi-bin/DW/Controller/Rename.pm
--- a/cgi-bin/DW/Controller/Rename.pm	Tue Oct 18 18:09:56 2011 +0800
+++ b/cgi-bin/DW/Controller/Rename.pm	Tue Oct 18 18:19:19 2011 +0800
@@ -317,7 +317,7 @@
         token => $token,
     };
 
-    if ( LJ::did_post() ) {
+    if ( $r->did_post ) {
         my ( $post_ok, $rv ) = handle_admin_post( $token, $post_args,
                     journal     => $u,
                     from_user    => $token->fromuser,
diff -r 993ddcd9fc22 -r 2d35bfea266d cgi-bin/DW/Controller/Search/Interests.pm
--- a/cgi-bin/DW/Controller/Search/Interests.pm	Tue Oct 18 18:09:56 2011 +0800
+++ b/cgi-bin/DW/Controller/Search/Interests.pm	Tue Oct 18 18:19:19 2011 +0800
@@ -28,7 +28,7 @@
 
 sub interest_handler {
     my $r = DW::Request->get;
-    my $did_post = LJ::did_post();
+    my $did_post = $r->did_post;
     my $args = $did_post ? $r->post_args : $r->get_args;
     return error_ml( 'bml.badinput.body' ) unless LJ::text_in( $args );
     return error_ml( 'error.invalidform' )
diff -r 993ddcd9fc22 -r 2d35bfea266d cgi-bin/DW/Controller/Shop.pm
--- a/cgi-bin/DW/Controller/Shop.pm	Tue Oct 18 18:09:56 2011 +0800
+++ b/cgi-bin/DW/Controller/Shop.pm	Tue Oct 18 18:19:19 2011 +0800
@@ -86,7 +86,7 @@
     $rv->{has_points} = $remote->shop_points;
 
     my $r = DW::Request->get;
-    if ( LJ::did_post() ) {
+    if ( $r->did_post ) {
         my $args = $r->post_args;
         die "invalid auth\n" unless LJ::check_form_auth( $args->{lj_form_auth} );
 
@@ -191,7 +191,7 @@
     $rv->{errs} = \%errs;
 
     my $r = DW::Request->get;
-    if ( LJ::did_post() ) {
+    if ( $r->did_post ) {
         my $args = $r->post_args;
         die "invalid auth\n" unless LJ::check_form_auth( $args->{lj_form_auth} );
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

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