11<?php
22/*
3- * jQuery File Upload Plugin PHP Class 6.1
3+ * jQuery File Upload Plugin PHP Class 6.1.1
44 * https://github.com/blueimp/jQuery-File-Upload
55 *
66 * Copyright 2010, Sebastian Tschan
@@ -166,9 +166,15 @@ protected function get_upload_path($file_name = null, $version = null) {
166166 .$ version_path .$ file_name ;
167167 }
168168
169+ protected function get_query_separator ($ url ) {
170+ return strpos ($ url , '? ' ) === false ? '? ' : '& ' ;
171+ }
172+
169173 protected function get_download_url ($ file_name , $ version = null ) {
170174 if ($ this ->options ['download_via_php ' ]) {
171- $ url = $ this ->options ['script_url ' ].'?file= ' .rawurlencode ($ file_name );
175+ $ url = $ this ->options ['script_url ' ]
176+ .$ this ->get_query_separator ($ this ->options ['script_url ' ])
177+ .'file= ' .rawurlencode ($ file_name );
172178 if ($ version ) {
173179 $ url .= '&version= ' .rawurlencode ($ version );
174180 }
@@ -181,7 +187,8 @@ protected function get_download_url($file_name, $version = null) {
181187
182188 protected function set_file_delete_properties ($ file ) {
183189 $ file ->delete_url = $ this ->options ['script_url ' ]
184- .'?file= ' .rawurlencode ($ file ->name );
190+ .$ this ->get_query_separator ($ this ->options ['script_url ' ])
191+ .'file= ' .rawurlencode ($ file ->name );
185192 $ file ->delete_type = $ this ->options ['delete_type ' ];
186193 if ($ file ->delete_type !== 'DELETE ' ) {
187194 $ file ->delete_url .= '&_method=DELETE ' ;
0 commit comments