Changeset 2214401
- Timestamp:
- 12/18/2019 03:56:44 PM (6 years ago)
- Location:
- wp-autosave/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (3 diffs)
-
public/js/wp-autosave-editor-script.js (modified) (2 diffs)
-
wp-autosave.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-autosave/trunk/README.txt
r2172406 r2214401 5 5 Tags: save, autosave, editor, draft, post 6 6 Requires at least: 3.0.1 7 Tested up to: 5. 2.37 Tested up to: 5.3.1 8 8 Requires PHP: 5.6 9 9 Stable tag: 4.9 … … 58 58 59 59 == Changelog == 60 = 1.1.1 = 61 * Update to WordPress 5.3.* 62 60 63 = 1.1.0 = 61 64 * Update to WordPress 5.2.* … … 76 79 77 80 == Upgrade Notice == 81 = 1.1.1 = 82 * Update to WordPress 5.3.* 83 78 84 = 1.1.0 = 79 85 * Update to WordPress 5.2.* -
wp-autosave/trunk/public/js/wp-autosave-editor-script.js
r2172406 r2214401 190 190 } catch(e) {} 191 191 192 var boundary = generateRandom Hex(56);192 var boundary = generateRandomBoundary(56); 193 193 var endline = '\r\n'; 194 194 var separator = '--'; … … 218 218 * @param {*} length 219 219 */ 220 function generateRandomHex(length) { 221 var hex; 220 function 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); 222 227 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); 230 229 } 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(''); 237 237 } -
wp-autosave/trunk/wp-autosave.php
r2172406 r2214401 11 11 * Plugin Name: wp-autosave 12 12 * Description: Auto-save your post to draft at regular intervals 13 * Version: 1.1. 013 * Version: 1.1.1 14 14 * Author: wp-autosave team 15 15 * License: GPL-2.0+ … … 67 67 * Rename this for your plugin and update it as you release new versions. 68 68 */ 69 define( 'PLUGIN_NAME_VERSION', '1.1. 0' );69 define( 'PLUGIN_NAME_VERSION', '1.1.1' ); 70 70 71 71 /**
Note: See TracChangeset
for help on using the changeset viewer.