WordPress File Upload - Version 3.8.4

Version Description

  • dublicatespolicy attribute replaced by grammaticaly correct duplicatespolicy, however backward compatibility with the old attribute is maintained
Download this release

Release Info

Developer nickboss
Plugin Icon 128x128 WordPress File Upload
Version 3.8.4
Comparing to
See all releases

Code changes from version 3.8.3 to 3.8.4

lib/wfu_admin_browser.php CHANGED
@@ -601,7 +601,7 @@ function wfu_file_details($file_code, $errorstatus) {
601
  $echo_str .= "\n\t\t\t\t\t".'</tr>';
602
  $echo_str .= "\n\t\t\t\t\t".'<tr>';
603
  $echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
604
- $echo_str .= "\n\t\t\t\t\t\t\t".'<label>Uploaded From User</label>';
605
  $echo_str .= "\n\t\t\t\t\t\t".'</th>';
606
  $echo_str .= "\n\t\t\t\t\t\t".'<td>';
607
  $echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.$uploadername.'" readonly="readonly" style="width:auto;" />';
601
  $echo_str .= "\n\t\t\t\t\t".'</tr>';
602
  $echo_str .= "\n\t\t\t\t\t".'<tr>';
603
  $echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
604
+ $echo_str .= "\n\t\t\t\t\t\t\t".'<label>Uploaded By User</label>';
605
  $echo_str .= "\n\t\t\t\t\t\t".'</th>';
606
  $echo_str .= "\n\t\t\t\t\t\t".'<td>';
607
  $echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.$uploadername.'" readonly="readonly" style="width:auto;" />';
lib/wfu_admin_composer.php CHANGED
@@ -50,6 +50,8 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
50
  // complete defs array and index dependencies
51
  $governors = array();
52
  $shortcode_attrs = wfu_shortcode_string_to_array($shortcode);
 
 
53
  $shortcode_id = '';
54
  foreach ( $defs as $key => $def ) {
55
  $attr = $def['attribute'];
50
  // complete defs array and index dependencies
51
  $governors = array();
52
  $shortcode_attrs = wfu_shortcode_string_to_array($shortcode);
53
+ //replace old attribute definitions with new ones
54
+ $shortcode_attrs = wfu_old_to_new_attributes($shortcode_attrs);
55
  $shortcode_id = '';
56
  foreach ( $defs as $key => $def ) {
57
  $attr = $def['attribute'];
lib/wfu_attributes.php CHANGED
@@ -961,7 +961,7 @@ function wfu_attribute_definitions() {
961
  ),
962
  array(
963
  "name" => "File Duplicates Policy",
964
- "attribute" => "dublicatespolicy",
965
  "type" => "radio",
966
  "listitems" => array("overwrite", "reject", "*maintain both"),
967
  "value" => WFU_VAR("WFU_DUBLICATESPOLICY"),
@@ -982,10 +982,10 @@ function wfu_attribute_definitions() {
982
  "mode" => "free",
983
  "category" => "general",
984
  "subcategory" => "Upload Path and Files",
985
- "parent" => "dublicatespolicy",
986
  "dependencies" => null,
987
  "variables" => null,
988
- "help" => "If dublicatespolicy is set to 'maintain both', then this rule defines how the uploaded file will be renamed, in order not to match an existing file. An incremental index number or a datetime stamp can be included in the uploaded file name to make it unique."
989
  ),
990
  array(
991
  "name" => "Redirect after Upload",
961
  ),
962
  array(
963
  "name" => "File Duplicates Policy",
964
+ "attribute" => "duplicatespolicy",
965
  "type" => "radio",
966
  "listitems" => array("overwrite", "reject", "*maintain both"),
967
  "value" => WFU_VAR("WFU_DUBLICATESPOLICY"),
982
  "mode" => "free",
983
  "category" => "general",
984
  "subcategory" => "Upload Path and Files",
985
+ "parent" => "duplicatespolicy",
986
  "dependencies" => null,
987
  "variables" => null,
988
+ "help" => "If duplicatespolicy is set to 'maintain both', then this rule defines how the uploaded file will be renamed, in order not to match an existing file. An incremental index number or a datetime stamp can be included in the uploaded file name to make it unique."
989
  ),
990
  array(
991
  "name" => "Redirect after Upload",
lib/wfu_processfiles.php CHANGED
@@ -338,7 +338,7 @@ function wfu_process_files($params, $method) {
338
 
339
  if ($source_path) {
340
  $file_exists = file_exists($target_path);
341
- if ( !$file_exists || $params["dublicatespolicy"] == "" || $params["dublicatespolicy"] == "overwrite" ) {
342
  //redirect echo in internal buffer to receive and process any unwanted warning messages from wfu_upload_file
343
  ob_start();
344
  ob_clean();
@@ -372,7 +372,7 @@ function wfu_process_files($params, $method) {
372
  $file_output['admin_messages'] = wfu_join_strings("<br />", $file_output['admin_messages'], $wfu_upload_file_ret["admin_message"]);
373
  }
374
  }
375
- else if ( $file_exists && $params["dublicatespolicy"] == "maintain both" ) {
376
  $full_path = wfu_basedir($target_path);
377
  $name_part = $only_filename;
378
  $ext_part = "";
338
 
339
  if ($source_path) {
340
  $file_exists = file_exists($target_path);
341
+ if ( !$file_exists || $params["duplicatespolicy"] == "" || $params["duplicatespolicy"] == "overwrite" ) {
342
  //redirect echo in internal buffer to receive and process any unwanted warning messages from wfu_upload_file
343
  ob_start();
344
  ob_clean();
372
  $file_output['admin_messages'] = wfu_join_strings("<br />", $file_output['admin_messages'], $wfu_upload_file_ret["admin_message"]);
373
  }
374
  }
375
+ else if ( $file_exists && $params["duplicatespolicy"] == "maintain both" ) {
376
  $full_path = wfu_basedir($target_path);
377
  $name_part = $only_filename;
378
  $ext_part = "";
readme.txt CHANGED
@@ -137,6 +137,9 @@ There is an option in plugin's settings in Dashboard to relax the CSS rules, so
137
 
138
  == Changelog ==
139
 
 
 
 
140
  = 3.8.3 =
141
  * fixed bug of subdirectory selector that was not initializing correctly after upload
142
  * fixed slight widget incompatibility with customiser
@@ -586,6 +589,9 @@ Initial version.
586
 
587
  == Upgrade Notice ==
588
 
 
 
 
589
  = 3.8.3 =
590
  Minor upgrade to fix some bugs.
591
 
137
 
138
  == Changelog ==
139
 
140
+ = 3.8.4 =
141
+ * dublicatespolicy attribute replaced by grammaticaly correct duplicatespolicy, however backward compatibility with the old attribute is maintained
142
+
143
  = 3.8.3 =
144
  * fixed bug of subdirectory selector that was not initializing correctly after upload
145
  * fixed slight widget incompatibility with customiser
589
 
590
  == Upgrade Notice ==
591
 
592
+ = 3.8.4 =
593
+ Upgrade to fix some bugs.
594
+
595
  = 3.8.3 =
596
  Minor upgrade to fix some bugs.
597
 
release_notes.txt CHANGED
@@ -1,3 +1,3 @@
1
- <span><strong>Latest release notes: </strong>This release is a minor update and it only fixes some bugs. The most important of the them was that <strong>drag-n-drop</strong> feature was not working properly when the plugin was configured for <strong>single-button</strong> operation.</span><br /><br /><span>
2
 
3
  For more details about this version's changes please visit the Release Notes of the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">support page</a><span>.</span>
1
+ <!-- --><span><strong>Latest release notes: </strong>This release introduces some minor bug fixes in free version and replacement of <strong>dublicatespolicy</strong> attribute by grammaticaly correct <strong>duplicatespolicy</strong>. The Professional version of the plugin contains a </span><span style="text-decoration: underline; font-weight: bold;">very serious bug fix</span><span> that was cancelling upload of big files when <strong>captcha</strong> was enabled.</span><!-- --><!-- --><br /><br /><span>
2
 
3
  For more details about this version's changes please visit the Release Notes of the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">support page</a><span>.</span>
wordpress_file_upload.php CHANGED
@@ -4,7 +4,7 @@ if( !session_id() ) { session_start(); }
4
  /*
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
- Version: 3.8.3
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */
@@ -134,6 +134,8 @@ function wfu_include_lib() {
134
  if ( is_admin() ) return;
135
 
136
  function wordpress_file_upload_handler($incomingfrompost) {
 
 
137
  //process incoming attributes assigning defaults if required
138
  $defs_indexed = wfu_shortcode_attribute_definitions_adjusted($incomingfrompost);
139
  $incomingfrompost = shortcode_atts($defs_indexed, $incomingfrompost);
@@ -442,6 +444,21 @@ function wfu_get_subfolders_paths($params) {
442
  return $subfolder_paths;
443
  }
444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  function wfu_classic_before_upload_handler($ret, $attr) {
446
  //run only if start_time exists in $_REQUEST parameters
447
  if ( !isset($_REQUEST['start_time']) ) return $ret;
4
  /*
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
+ Version: 3.8.4
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */
134
  if ( is_admin() ) return;
135
 
136
  function wordpress_file_upload_handler($incomingfrompost) {
137
+ //replace old attribute definitions with new ones
138
+ $incomingfrompost = wfu_old_to_new_attributes($incomingfrompost);
139
  //process incoming attributes assigning defaults if required
140
  $defs_indexed = wfu_shortcode_attribute_definitions_adjusted($incomingfrompost);
141
  $incomingfrompost = shortcode_atts($defs_indexed, $incomingfrompost);
444
  return $subfolder_paths;
445
  }
446
 
447
+ function wfu_old_to_new_attributes($shortcode_attrs) {
448
+ //old to new attribute definitions
449
+ $old_to_new = array(
450
+ "dublicatespolicy" => "duplicatespolicy"
451
+ );
452
+ //implement changes
453
+ foreach ( $old_to_new as $old => $new ) {
454
+ if ( isset($shortcode_attrs[$old]) ) {
455
+ $shortcode_attrs[$new] = $shortcode_attrs[$old];
456
+ unset($shortcode_attrs[$old]);
457
+ }
458
+ }
459
+ return $shortcode_attrs;
460
+ }
461
+
462
  function wfu_classic_before_upload_handler($ret, $attr) {
463
  //run only if start_time exists in $_REQUEST parameters
464
  if ( !isset($_REQUEST['start_time']) ) return $ret;