Skip to content

Commit a73dd4e

Browse files
committed
Merge branch 'master' into jquery-ui
2 parents f6e88df + d33a91e commit a73dd4e

File tree

3 files changed

+31
-28
lines changed

3 files changed

+31
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The File Upload plugin is regularly tested with the latest browser versions and
7171
* Google Chrome
7272
* Apple Safari 4.0+
7373
* Mozilla Firefox 3.0+
74-
* Opera 10.0+
74+
* Opera 11.0+
7575
* Microsoft Internet Explorer 6.0+
7676

7777
### Mobile browsers

js/jquery.fileupload.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin 5.19.3
2+
* jQuery File Upload Plugin 5.19.4
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -10,7 +10,7 @@
1010
*/
1111

1212
/*jslint nomen: true, unparam: true, regexp: true */
13-
/*global define, window, document, Blob, FormData, location */
13+
/*global define, window, document, File, Blob, FormData, location */
1414

1515
(function (factory) {
1616
'use strict';
@@ -209,10 +209,10 @@
209209
if (typeof options.formData === 'function') {
210210
return options.formData(options.form);
211211
}
212-
if ($.isArray(options.formData)) {
212+
if ($.isArray(options.formData)) {
213213
return options.formData;
214214
}
215-
if (options.formData) {
215+
if (options.formData) {
216216
formData = [];
217217
$.each(options.formData, function (name, value) {
218218
formData.push({name: name, value: value});
@@ -345,10 +345,12 @@
345345
formData.append(paramName, options.blob, file.name);
346346
} else {
347347
$.each(options.files, function (index, file) {
348-
// File objects are also Blob instances.
348+
// Files are also Blob instances, but some browsers
349+
// (Firefox 3.6) support the File API but not Blobs.
349350
// This check allows the tests to run with
350351
// dummy objects:
351-
if (file instanceof Blob) {
352+
if ((window.Blob && file instanceof Blob) ||
353+
(window.File && file instanceof File)) {
352354
formData.append(
353355
options.paramName[index] || paramName,
354356
file,
@@ -758,7 +760,8 @@
758760
that._onSend(e, this);
759761
return this.jqXHR;
760762
};
761-
return (result = that._trigger('add', e, newData));
763+
result = that._trigger('add', e, newData);
764+
return result;
762765
});
763766
return result;
764767
},

server/php/UploadHandler.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function __construct($options = null, $initialize = true) {
5353
'GET',
5454
'POST',
5555
'PUT',
56-
'PATCH',
56+
'PATCH',
5757
'DELETE'
5858
),
5959
'access_control_allow_headers' => array(
@@ -124,8 +124,8 @@ protected function initialize() {
124124
case 'GET':
125125
$this->get();
126126
break;
127-
case 'PATCH':
128-
case 'PUT':
127+
case 'PATCH':
128+
case 'PUT':
129129
case 'POST':
130130
$this->post();
131131
break;
@@ -461,16 +461,16 @@ protected function orient_image($file_path) {
461461
$image = @imagecreatefromjpeg($file_path);
462462
switch ($orientation) {
463463
case 3:
464-
$image = @imagerotate($image, 180, 0);
465-
break;
464+
$image = @imagerotate($image, 180, 0);
465+
break;
466466
case 6:
467-
$image = @imagerotate($image, 270, 0);
468-
break;
467+
$image = @imagerotate($image, 270, 0);
468+
break;
469469
case 8:
470-
$image = @imagerotate($image, 90, 0);
471-
break;
470+
$image = @imagerotate($image, 90, 0);
471+
break;
472472
default:
473-
return false;
473+
return false;
474474
}
475475
$success = imagejpeg($image, $file_path);
476476
// Free up memory (imagedestroy does not delete files):
@@ -540,17 +540,17 @@ protected function handle_file_upload($uploaded_file, $name, $size, $type, $erro
540540
return $file;
541541
}
542542

543-
protected function readfile($file_path) {
544-
return readfile($file_path);
545-
}
543+
protected function readfile($file_path) {
544+
return readfile($file_path);
545+
}
546546

547-
protected function body($str) {
548-
echo $str;
549-
}
550-
551-
protected function header($str) {
552-
header($str);
553-
}
547+
protected function body($str) {
548+
echo $str;
549+
}
550+
551+
protected function header($str) {
552+
header($str);
553+
}
554554

555555
protected function generate_response($content, $print_response = true) {
556556
if ($print_response) {

0 commit comments

Comments
 (0)