Skip to content

Commit 57bde49

Browse files
Merge pull request #15 from soflyy/fix/do-not-allow-objects-to-be-unserialized
fix: don't instantiate serialized objects
2 parents ee64806 + dbe1cdc commit 57bde49

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

import-users-from-csv.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Import Users from CSV
44
Plugin URI: https://wordpress.org/plugins/import-users-from-csv/
55
Description: Import Users data and metadata from a csv file.
6-
Version: 1.2
6+
Version: 1.3
77
Author: WP All Import
88
Author URI: https://www.wpallimport.com/
99
License: GPL2
@@ -422,7 +422,9 @@ public static function import_csv( $filename, $args ) {
422422
/* If no error, let's update the user meta too! */
423423
if ( $usermeta ) {
424424
foreach ( $usermeta as $metakey => $metavalue ) {
425-
$metavalue = maybe_unserialize( $metavalue );
425+
if(is_serialized($metavalue)){
426+
$metavalue = unserialize(trim($metavalue), ['allowed_classes' => false]);
427+
}
426428
update_user_meta( $user_id, $metakey, $metavalue );
427429
}
428430
}

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: import users from csv, import users, import csv, users, csv
44
Requires at least: 3.1
55
Requires PHP: 7.0
66
Tested up to: 6.4.2
7-
Stable tag: 1.2
7+
Stable tag: 1.3
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -96,6 +96,9 @@ Thanks to Ulrich Sossou for initially creating this plugin. Be sure to [check ou
9696

9797
== Changelog ==
9898

99+
= 1.3 =
100+
* bug fix: don't instantiate serialized objects
101+
99102
= 1.2 =
100103
* BUG FIX: Ensure user running import has the ability to add users
101104
* Update tested to

0 commit comments

Comments
 (0)