From b8436674f60bb04b5ee238141d699db9b2f6cac6 Mon Sep 17 00:00:00 2001 From: Michael Casadevall Date: Sat, 16 May 2015 03:07:35 +0000 Subject: [PATCH] Fix blob module to handle MP2 API stupidness Signed-off-by: Michael Casadevall --- Slash/Apache/User/User.pm | 3 +-- plugins/Admin/admin.pl | 12 ++++++++++-- plugins/Blob/fileadmin.pl | 6 +++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Slash/Apache/User/User.pm b/Slash/Apache/User/User.pm index 6657430cb..70009ddbd 100644 --- a/Slash/Apache/User/User.pm +++ b/Slash/Apache/User/User.pm @@ -88,7 +88,7 @@ sub handler { my $reader_user = $slashdb->getDB('reader'); my $reader = getObject('Slash::DB', { virtual_user => $reader_user }); - my $version_code = "slashcode"; + my $version_code = "rehash"; $version_code .= " $Slash::VERSION"; if ($constants->{cvs_tag_currentcode_emit} && $constants->{cvs_tag_currentcode} @@ -117,7 +117,6 @@ sub handler { my $form = filter_params($apr); - $form->{query_apache} = $apr; @{$form}{keys %{$constants->{form_override}}} = values %{$constants->{form_override}}; diff --git a/plugins/Admin/admin.pl b/plugins/Admin/admin.pl index 5ebd685ff..06ffac253 100755 --- a/plugins/Admin/admin.pl +++ b/plugins/Admin/admin.pl @@ -12,6 +12,9 @@ use URI; use Encode 'decode_utf8'; +use Apache2::RequestUtil; +use Apache2::Request; +use Apache2::Upload; use Slash; use Slash::Display; use Slash::Hook; @@ -1105,7 +1108,10 @@ sub editStory { # Basically, we upload the bodytext if we realize a name has been passed in -Brian if ($form->{bodytext_file}) { - my $upload = $form->{query_apache}->upload; + my $r = Apache2::RequestUtil->request; + my $req = Apache2::Request->new($r); + my $upload = $req->upload("bodytext_file"); + if ($upload) { my $temp_body; $form->{bodytext} = ''; @@ -1935,7 +1941,9 @@ sub handleMediaFileForStory { my $savefile = !$saveblob; if ($form->{media_file}) { - my $upload = $form->{query_apache}->upload; + my $r = Apache2::RequestUtil->request; + my $req = Apache2::Request->new($r); + my $upload = $req->upload("bodytext_file"); if ($upload) { my $fh = $upload->fh; use File::Path; diff --git a/plugins/Blob/fileadmin.pl b/plugins/Blob/fileadmin.pl index 604a9bf67..2774692e2 100755 --- a/plugins/Blob/fileadmin.pl +++ b/plugins/Blob/fileadmin.pl @@ -11,6 +11,8 @@ use Slash::Display; use Slash::Utility; +use Apache2::Upload; + use vars qw($VERSION); ($VERSION) = ' $Revision$ ' =~ /\$Revision:\s+([^\s]+)/; @@ -100,7 +102,9 @@ sub addFileForStory { if ($form->{file_content}) { my $data; if ($form->{file_content}) { - my $upload = $form->{query_apache}->upload; + my $r = Apache2::RequestUtil->request; + my $req = Apache2::Request->new($r); + my $upload = $req->upload("file_content"); if ($upload) { my $temp_body; my $fh = $upload->fh;