Plugin Directory

Changeset 2214401


Ignore:
Timestamp:
12/18/2019 03:56:44 PM (6 years ago)
Author:
wpautosave
Message:

Update plugin to version 1.1.1

Location:
wp-autosave/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-autosave/trunk/README.txt

    r2172406 r2214401  
    55Tags: save, autosave, editor, draft, post
    66Requires at least: 3.0.1
    7 Tested up to: 5.2.3
     7Tested up to: 5.3.1
    88Requires PHP: 5.6
    99Stable tag: 4.9
     
    5858
    5959== Changelog ==
     60= 1.1.1 =
     61* Update to WordPress 5.3.*
     62
    6063= 1.1.0 =
    6164* Update to WordPress 5.2.*
     
    7679
    7780== Upgrade Notice ==
     81= 1.1.1 =
     82* Update to WordPress 5.3.*
     83
    7884= 1.1.0 =
    7985* Update to WordPress 5.2.*
  • wp-autosave/trunk/public/js/wp-autosave-editor-script.js

    r2172406 r2214401  
    190190    } catch(e) {}
    191191
    192     var boundary = generateRandomHex(56);
     192    var boundary = generateRandomBoundary(56);
    193193    var endline = '\r\n';
    194194    var separator = '--';
     
    218218 * @param {*} length
    219219 */
    220 function generateRandomHex(length) {
    221   var hex;
     220function generateRandomBoundary(length) {
     221  var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     222  var charAt = function(i) {
     223    return chars[i % chars.length];
     224  }
     225
     226  var boundary = new Uint8Array(length);
    222227  if (window.crypto && window.crypto.getRandomValues && Uint8Array) {
    223     hex = new Uint8Array(length);
    224     window.crypto.getRandomValues(hex);
    225     hex = hex
    226       .toString()
    227       .split(',')
    228       .map(function(v) { return parseInt(v, 10).toString(16) })
    229       .join('');
     228    window.crypto.getRandomValues(boundary);
    230229  } else {
    231     hex = '';
    232     while (hex.length < length) {
    233       hex += Math.random().toString(16).split('.').pop();
    234     }
    235   }
    236   return hex.slice(0, length);
     230    boundary.forEach((_, i) => {boundary[i] = Math.random()*chars.length});
     231  }
     232
     233  return Array
     234    .from(boundary, (v) => charAt(v))
     235    .slice(0, length)
     236    .join('');
    237237}
  • wp-autosave/trunk/wp-autosave.php

    r2172406 r2214401  
    1111 * Plugin Name:       wp-autosave
    1212 * Description:       Auto-save your post to draft at regular intervals
    13  * Version:           1.1.0
     13 * Version:           1.1.1
    1414 * Author:            wp-autosave team
    1515 * License:           GPL-2.0+
     
    6767 * Rename this for your plugin and update it as you release new versions.
    6868 */
    69 define( 'PLUGIN_NAME_VERSION', '1.1.0' );
     69define( 'PLUGIN_NAME_VERSION', '1.1.1' );
    7070
    7171/**
Note: See TracChangeset for help on using the changeset viewer.