Bugzilla – Attachment 8584 Details for
Bug 7775
tools/upload-file.pl: scope $uploaded_file for plack
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7775 - tools/upload-file.pl: scoping for plack
Bug-7775---toolsupload-filepl-scoping-for-plack.patch (text/plain), 1.38 KB, created by
Dobrica Pavlinusic
on 2012-03-23 11:09:26 UTC
(
hide
)
Description:
Bug 7775 - tools/upload-file.pl: scoping for plack
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2012-03-23 11:09:26 UTC
Size:
1.38 KB
patch
obsolete
>From 73d3d3e6da71a4f36e0ffb046a2fc64cd1b9109f Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Wed, 21 Mar 2012 11:47:49 +0100 >Subject: [PATCH] Bug 7775 - tools/upload-file.pl: scoping for plack > >$uploaded_file is now scoped with our, and we set correct filename >--- > tools/upload-file.pl | 7 ++----- > 1 files changed, 2 insertions(+), 5 deletions(-) > >diff --git a/tools/upload-file.pl b/tools/upload-file.pl >index d520b4d..b705f5c 100755 >--- a/tools/upload-file.pl >+++ b/tools/upload-file.pl >@@ -46,7 +46,7 @@ if ($auth_status ne "ok") { > exit 0; > } > >-my $uploaded_file = C4::UploadedFile->new($sessionID); >+our $uploaded_file = C4::UploadedFile->new($sessionID); > unless (defined $uploaded_file) { > # FIXME - failed to create file for some reason > send_reply('failed', ''); >@@ -54,8 +54,6 @@ unless (defined $uploaded_file) { > } > $uploaded_file->max_size($ENV{'CONTENT_LENGTH'}); # may not be the file size, exactly > >-my $first_chunk = 1; >- > my $query; > $query = new CGI \&upload_hook; > $uploaded_file->done(); >@@ -68,9 +66,8 @@ exit 0; > sub upload_hook { > my ($file_name, $buffer, $bytes_read, $session) = @_; > $uploaded_file->stash(\$buffer, $bytes_read); >- if ($first_chunk) { >+ if ( ! $uploaded_file->name && $file_name ) { # save name on first chunk > $uploaded_file->name($file_name); >- $first_chunk = 0; > } > } > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7775
:
8398
|
8426
|
8584
|
8586