From 1a5d7e400d073eeb39132ef2930783287b6a0ced Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 3 Feb 2018 08:46:34 -0500 Subject: [PATCH] fix backward compatibility of restore from backup feature --- src/js/about.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/about.js b/src/js/about.js index 22aa5c8..1d16b8a 100644 --- a/src/js/about.js +++ b/src/js/about.js @@ -1,7 +1,7 @@ /******************************************************************************* uMatrix - a Chromium browser extension to black/white list requests. - Copyright (C) 2014-2017 Raymond Hill + Copyright (C) 2014-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,11 +56,12 @@ function restoreUserDataFromFile() { } if ( typeof userData !== 'object' || + typeof userData.app !== 'string' || typeof userData.version !== 'string' || typeof userData.when !== 'number' || typeof userData.settings !== 'object' || - typeof userData.rules !== 'string' || - typeof userData.hostsFiles !== 'object' + (typeof userData.rules !== 'string' && + Array.isArray(userData.rules) === false) ) { return null; }